The definition is as follows [the red part is appended, which is the key to solving the problem ]:
VaR bu_store = ext. Create ('ext. Data. store ',{
Fields: ['key', 'value'],
Remotesort: True, // whether to sort data on the server
Proxy :{
Type: 'ajax ', // obtain data asynchronously. The URL here can be changed to any dynamic page, as long as JSON data is returned.
URL: 'soc/getbu ',
Reader :{
Root: 'items'
},
Simplesortmode: True
}
});
VaR evt_bu = new Ext. Form. ComboBox ({
ID: 'evt _ Bu ',
Fieldlabel: 'bus ',
Width: 240,
Store: bu_store,
Displayfield: 'value ',
Valuefield: 'key ',
Triggeraction: 'all ',
Emptytext: 'select ...',
Allowblank: false,
Blanktext: 'select Bu ',
Editable: false,
Mode: 'local', // This attribute is compatible with IE8 in the following ways
Listeners :{
'Render': function (){
Bu_store.load ();
}
}
});
VaR pdl_store = ext. Create ('ext. Data. store ',{
Fields: ['key', 'value'],
Remotesort: True, // whether to sort data on the server
Autoload: false,
Proxy :{
Type: 'ajax ', // obtain data asynchronously. The URL here can be changed to any dynamic page, as long as JSON data is returned.
URL: 'soc/getpdl ',
Reader :{
Root: 'items'
},
Simplesortmode: True
}
});
Pdl_store.on ("beforeload", function (){
Ext. Apply (pdl_store.proxy.extraparams, {'Bu ': evt_bu.getvalue ()});
});
VaR evt_pdl = new Ext. Form. ComboBox ({
Fieldlabel: '& nbsp; product line ',
Width: 240,
Store: pdl_store,
Listconfig: {loadmask: false },
Displayfield: 'value ',
Valuefield: 'key ',
Triggeraction: 'all ',
Emptytext: 'select ...',
Allowblank: false,
Blanktext: 'select product line ',
Editable: false
});
// Linkage implementation
Evt_bu.on ('select', function (){
Evt_pdl.clearvalue ();
Try {
Pdl_store.load ();
}
Catch (Ex ){
Ext. MessageBox. Alert ("error", "data loading failed. ");
}
});