1. #1
    Sencha User
    Join Date
    Mar 2011
    Location
    Betelgeuse VII
    Posts
    86
    Answers
    3
    Vote Rating
    3
    fordprefect is on a distinguished road

      0  

    Default 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:

    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'
    });
    with a store:

    Code:
    Ext.define('MyApp.store.CategoryStore', {
        extend: 'Ext.data.Store',
        model: 'MyApp.model.CategoryModel',
    
        proxy: {
            type: 'ajax',
            url: '/MyApp/Canvas/GetCategories',
            reader: {
                type: 'json'
            }
        }
    });
    In IE8 the combo box does not contain any records, all the other browsers work fine in populating the store and combo box.

    I tried to populate the store in the controller:

    Code:
    this.getStore("CategoryStore").load({
        callback: function (records, operation, success) {
                alert(records);
         }
    });
    But the records reported a null value (again, in other browsers it was fine).

    Is there a trick to creating stores so that they work in IE8 or have I missed something obvious?

    Thanks for any ideas.

  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?

  3. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,492
    Answers
    526
    Vote Rating
    283
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    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?

  4. #3
    Sencha User
    Join Date
    Mar 2011
    Location
    Betelgeuse VII
    Posts
    86
    Answers
    3
    Vote Rating
    3
    fordprefect is on a distinguished road

      0  

    Default


    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:

    Code:
    Ext.define('MyApp.model.CategoryModel', {
        extend: 'Ext.data.Model',
    
        fields: [
           { name: 'CategoryId', type: 'int' },
           { name: 'Name', type: 'string' },
        ]
    });
    Removing the comma allowed the store to load in IE8.

    Cheers.

  5. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,492
    Answers
    526
    Vote Rating
    283
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    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?

  6. #5
    Sencha User
    Join Date
    Mar 2011
    Location
    Betelgeuse VII
    Posts
    86
    Answers
    3
    Vote Rating
    3
    fordprefect is on a distinguished road

      0  

    Default


    Quote Originally Posted by skirtle View Post
    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?
    Wow, you're fast - caught me in the edit.

    My mistake, using fiddler the json response is:

    Code:
    [{"CategoryId":10,"Name":"Capital"},{"CategoryId":8,"Name":"Environment"},{"CategoryId":7,"Name":"Transportation"}]
    Thanks again.

Thread Participants: 1

Tags for this Thread