读书人

ext二级联动兑现

发布时间: 2012-10-25 10:58:58 作者: rapoo

ext二级联动实现
今天用ext实现二级联动,原来以为很简单,但是试了半天,第二个下拉列表就是不能显示
后来发现后台向前台传json值用了对象,显示就出了问题,费了半天劲才搞出来,

 certifcateTypeStore = new Ext.data.JsonStore({    url:'../getCertificateTypeListByArray',       root:'certificateTypeList',fields:['certificateTypeId','certificateTypeName']     }); qytg_certificateTypeComb=new Ext.form.ComboBox({margins:'0 0 0 0', fieldLabel: '证书类型',displayField:'certificateTypeName',valueField:'certificateTypeId',allowBlank:true, height: 25,            anchor: '95%',editable : false,mode:'local',store:certifcateTypeStore,triggerAction : 'all' }); certifcateLevelStore= new Ext.data.JsonStore({  fields:['certificateLevel']     });  var qytg_certificateLevelComb=new Ext.form.ComboBox({margins:'0 0 0 0',//disabled:true, //forceSelection: true,fieldLabel: '证书等级',displayField:'certificateLevel',valueField:'certificateLevel',allowBlank:true, anchor: '95%',editable : false,mode:'local',store:certifcateLevelStore,triggerAction : 'all' }); qytg_certificateTypeComb.on('select', function (combo, record,index) {   qytg_certificateLevelComb.clearValue();                                  Ext.Ajax.request({                   url :'../getCertificateLevelList',                   mthod : 'post',                    params:{                   certificateID:qytg_certificateTypeComb.getValue()                   },                   success : function(response) {                            var result = Ext.util.JSON.decode(response.responseText);                                                 qytg_certificateLevelComb.getStore().loadData(result.levellist);                        }                })  ;              } );

读书人网 >Web前端

热点推荐