Ext之自定义组件,之ComboBox之Ajax查询

//类型
var sto = new Ext.data.JsonStore({
         id:'ds',
         totalProperty:'totalProperty',
         root:'root',
         url:'/commplat/json_service.do',
         baseParams:{
             jsonlist:'jsonlist',
             serviceClassName:'com.rtt.emergency.resource.service.http.cameraTypesServiceJSON',
             serviceMethodName:'queryCameraType'
         },
         fields: [
            {name: 'typeId',type: 'string'},
            {name: 'typeName',type: 'string'}
           
         ],
         pruneModifiedRecords:true
});
sto.load();

var ctype=new Ext.form.ComboBox({
      id:'ctMonitor',
      name:'typeId',
      maxLength:80,
      width:160,
      fieldLabel:'类型',
      triggerAction:"all",//是否开启自动查询功能
      store:sto,//定义数据源
      displayField:"typeName",//关联某一个逻辑列名作为显示值
      valueField:"typeId",//关联某一个逻辑列名作为实际值
      mode:"local",//如果数据来自本地用local 如果来自远程用remote默认为remote
      emptyText:"请选择类型"//没有选择时候的默认值
});

















-

你可能感兴趣的:(ext,combobox,自动查询)