ext_comboBox二级级联下拉框

代码示例:

Ext.onReady(function(){ var store = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({url: 'ConjunctSelectProcess.jsp'}), reader: new Ext.data.JsonReader({ totalProperty: 'recordCount', root:'rows' }, [{name: 'id'}, {name: 'name'}]) }); var store2 = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({url: 'ConjunctSelectProcess.jsp?id='}), reader: new Ext.data.JsonReader({ totalProperty: 'recordCount', root:'rows' }, [{name: 'id'}, {name: 'name'}]) }); var combo = new Ext.form.ComboBox({ store: store, displayField:'name', valueField: 'id' , typeAhead: true, mode: 'local', triggerAction: 'all', emptyText:'请选择...', selectOnFocus:true }); combo.applyTo('sel1'); var combo2 = new Ext.form.ComboBox({ store: store2, displayField:'name', valueField: 'id' , typeAhead: true, mode: 'local', triggerAction: 'all', emptyText:'请选择...', selectOnFocus:true }); combo2.applyTo('sel2'); combo.store.load(); combo.on('select', function() { combo2.reset(); store2.proxy= new Ext.data.HttpProxy({url: 'ConjunctSelectProcess.jsp?id=' + combo.getValue()}); store2.load(); }); });

 

你可能感兴趣的:(function,ext,url)