About ExtJS combobox in IE can not display the problem to solve, we have been analyzed to achieve, and finally to solve the solution. Look at the example below.
The data in ComboBox is populated by server-side data, and a lot of the online examples are just a few, as follows
var companies = new Ext.data.JsonStore ({
URL: '/company/getcompanies/',
Root: ' Companies ',
Fields: [
{name: ' CompanyID '}, {name: ' CompanyName '}]
});
Implementation of ComboBox:
New Ext.form.ComboBox ({
Fieldlabel: ' Company ',
Typeahead:false,
TriggerAction: ' All ',
Valuefield: ' CompanyID ',
Hiddenname: ' CompanyID ',
Displayfield: ' CompanyName ',
Mode: ' Remote ',
Lazyrender:true,
Store:companies,
Allowblank:true,
Editable:false,
Listeners: {
' Focus ': function () {
if (Companies.data.length > 0) {
Debugger This is used for debugging.
}
}
}
})
Returns the JSON string {"companies": [{"CompanyID": 1, "CompanyName": "Test"},{"CompanyID": 2, "CompanyName": "Test1"},{"CompanyID": 3 , "CompanyName": "Test2"}]}
The result is a normal display in Firefox, but it doesn't work in IE.
The solution is simple, change the store to read as follows:
var companies = new Ext.data.Store ({
Proxy:new Ext.data.HttpProxy ({
URL: '/company/getcompanies/',
Method: ' Get '//Here is the key ****************
}),
Reader:new Ext.data.JsonReader ({
Root: ' Companies '
},
[{name: ' CompanyID ', Mapping: ' CompanyID '},
{name: ' CompanyName ', Mapping: ' CompanyName '}
])
});