ExtJS combobox in IE can not display the problem to solve

Source: Internet
Author: User

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 '}
])
});

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.