1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    363
    Vote Rating
    2
    raj_plays is on a distinguished road

      0  

    Question cannot populate Combo with dynamic array

    cannot populate Combo with dynamic array


    Hi, I am trying to populate an Ext.form.ComboBox using a dynamically created 2 - d array.
    Whereas a static 2 - d array like the one below works
    Code:
    var messageTypecombo = new Ext.form.ComboBox({
        allowBlank: false,
        typeAhead: true,
        triggerAction: 'all',
        store: new Ext.data.SimpleStore({
            fields: ['value', 'name'],
            data: [
                [0, 'Station Promo'],
                [1, 'Program Promo'],
                [2, 'Sponsor']
            ]
        }),
        mode: 'local',
        displayField: 'name',
        valueField: 'value'
    });
    The dynamic array like the one below does not. It displays only a 0 in the combo box
    Code:
    var messageTypesArr = [];
    messageTypesArr.push([0, 'Station Promo']);
    messageTypesArr.push([1, 'Program Promo']);
    messageTypesArr.push([2, 'Sponsor']);
    Code:
    
    var messageTypecombo = new Ext.form.ComboBox({
        allowBlank: false,
        typeAhead: true,
        triggerAction: 'all',
        store: new Ext.data.SimpleStore({
            fields: ['value', 'name'],
            data: messageTypesArr
        }),
        mode: 'local',
        displayField: 'name',
        valueField: 'value'
    });
     


    Please help


  2. #2
    Sencha User
    Join Date
    Dec 2009
    Posts
    363
    Vote Rating
    2
    raj_plays is on a distinguished road

      0  

    Default


    Found the error.
    I was trying to pouplate the combo before the dynamic array had been loaded.
    Silly me.

    Dear Admin, please delete this thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar