-
4 Apr 2012 2:41 PM #1
Answered: [RC2] IE8 not populating Combo box
Answered: [RC2] IE8 not populating Combo box
Hi,
I have a mvc application that has a combo box defined:
with a store:Code:Ext.define('MyApp.view.canvas.Category', { extend: 'Ext.form.field.ComboBox', alias: 'widget.canvascategory', emptyText: 'Select A Category', fieldLabel: 'Category', store: 'CategoryStore', displayField: 'Name', valueField: 'CategoryId' });
In IE8 the combo box does not contain any records, all the other browsers work fine in populating the store and combo box.Code:Ext.define('MyApp.store.CategoryStore', { extend: 'Ext.data.Store', model: 'MyApp.model.CategoryModel', proxy: { type: 'ajax', url: '/MyApp/Canvas/GetCategories', reader: { type: 'json' } } });
I tried to populate the store in the controller:
But the records reported a null value (again, in other browsers it was fine).Code:this.getStore("CategoryStore").load({ callback: function (records, operation, success) { alert(records); } });
Is there a trick to creating stores so that they work in IE8 or have I missed something obvious?
Thanks for any ideas.
-
Best Answer Posted by skirtle
What does your JSON look like? Is it definitely valid, e.g. no stray commas?
Exactly which ExtJS build are you using?
Did this work against 4.0?
-
5 Apr 2012 2:08 AM #2
What does your JSON look like? Is it definitely valid, e.g. no stray commas?
Exactly which ExtJS build are you using?
Did this work against 4.0?
-
5 Apr 2012 8:31 AM #3
Thanks for your response skirtle, your comment about commas sent me looking. The json string coming back was fine, however I had left a comma in my model defintion:
Removing the comma allowed the store to load in IE8.Code:Ext.define('MyApp.model.CategoryModel', { extend: 'Ext.data.Model', fields: [ { name: 'CategoryId', type: 'int' }, { name: 'Name', type: 'string' }, ] });
Cheers.
-
5 Apr 2012 8:40 AM #4
I'm going to move this thread to the Q&A forum.
Your JSON is invalid. It shouldn't contain all those slashes. I'm surprised it works in any browser, are you sure that's exactly what's coming back from the server?
-
5 Apr 2012 8:45 AM #5


Reply With Quote
