下拉框之——动态获取数据
adduser.securityDegree1=null;adduser.securityDegree = new Ext.form.ComboBox( {store : new Ext.data.Store( {proxy : new Ext.data.HttpProxy( {url : '../JSON/groups_GroupsRemote.getSecurityDegree'}),reader : new Ext.data.JsonReader( {totalProperty : 'totalProperty',root : 'root'}, [ {name : 'id'}, {name : 'name'} ])}),fieldLabel : "密级"',hiddenName : 'securityDegree',valueField : "id",displayField : "name",mode : 'remote',allowBlank : true,disabled : false,forceSelection : true,editable : false,triggerAction : 'all',emptyText : 请选择密级*...,labelStyle : 'padding:5px 0px 5px 0px',listeners : {select : function(combo, record, index) {adduser.securityDegree1 = record.get('id');},beforequery : function(qe) {delete qe.combo.lastQuery;}},style : 'margin-bottom: 5px;',width : 175});后台用JSONArray和JSONObject返回数据:JSONObject obj = null;JSONArray ary = new JSONArray();for(Grops g:list){ obj = new JSONObject(); obj.put("id",g.getItemID()); obj.put("name",g.getItemName()); ary.add(obj);}obj = new JSONObject();obj.put(”totalProperty",ary.size());obj.put("root",ary);return obj.toString();obj.put("tatalProperty",ary.size());obj.put("root",ary);{xtype : 'combo',anchor : "90%",store : new Ext.data.Store({proxy : new Ext.data.HttpProxy({url : '../JSON/maintenance_deptype_deptypeService.getDeptypeName'}),reader : new Ext.data.JsonReader({totalProperty : 'totalProperty',root : 'results'}, [{name : 'typename'}, {name : 'deptypeid'}]),baseParams : {deptypeid : kind}}),valueField : "deptypeid",displayField : "typename",mode : 'remote',forceSelection : true,hiddenName : 'kind',editable : false,triggerAction : 'all',fieldLabel : '' + getResource('resourceParam686') + '',blankText : '' + getResource('resourceParam683') + '',name : 'kind',emptyText : '' + getResource('resourceParam684') + '',allowBlank : false}