How to solve the loading error in the Combobox interaction of Extjs4
When combobox is selected repeatedly, the lower-level Combobox will have a loading error, even though the Store data has been loaded.
You will know how to deal with the Code: (pay attention to the key statements in the red part)
},{
Xtype: 'combobox ',
LabelStyle: 'color: blue ;',
LabelWidth: 70, // label width
Width: 200, // field width
MsgTarget: 'day ',
AllowBlank: false, // whether null values are allowed
LabelStyle: 'color: red ;',
Value :'',
EmptyText: 'select a superior department .... ',
QueryMode: 'local ',
DisplayField: 'deptname ',
ValueField: 'deptname ',
Store: myUpDeptStore,
Editable: false,
TriggerAction: 'all ',
FieldLabel: "superior department ",
Listeners :{
'Select': function (combo, record, number) {// This event returns the record value of the selected item in the store. The index parameter is the Sn.
Var _ value = combo. getValue ();
Ext. getCmp ('addptcombo '). clearValue ();
Ext. getCmp ('addptcombo '). store. load ({params :{
UpDept: _ value // record [0]. data. DeptName
}
});
}
},
Name: "UpDept"
},{
Xtype: 'combobox ',
Id: 'addptcombo ',
DefaultListConfig: {// cancel the loading Mask
LoadMask: false
},
LabelStyle: 'color: blue ;',
LabelWidth: 70, // label width
Width: 200, // field width
MsgTarget: 'day ',
AllowBlank: false, // whether null values are allowed
LabelStyle: 'color: red ;',
Value :'',
EmptyText: 'select a department/team .... ',
QueryMode: 'local ',
DisplayField: 'deptname ',
ValueField: 'deptname ',
Store: myDeptStore,
Editable: false,
FieldLabel: "department ",
Name: "Dept"
}]
Note: This error should be caused by the Extjs Bug. The data has been loaded but the Mask layer has not been canceled, so we can only remove it manually.