1
votes

I have an editable grid and a store that loads from a proxy. Im using the store.collect() function to load a combobox to the editor of the grid, the thing is that the grid renders itself before the collect() function is finished, so I get an empty combo. How can I make sure the grid renders after the store is loaded? BTW it works fine if I don't use collect().

This is my grid editor combo:

editor: {
            xtype: 'combobox',
            store: store_ingredientes.collect('ALIMENTO_DESCRIPCION'),
            displayField: 'ALIMENTO_DESCRIPCION',
            queryMode: 'local',
            allowBlank: false
        }

If I log the collection on the load event of the store it works as spected:

load: function(){
            console.log( store_ingredientes.collect('ALIMENTO_DESCRIPCION'));
        }
1

1 Answers

1
votes

To wait until the store is loaded you can use:

yourStore.on('load', function(store, records, options){

        //this will be executed after store is loaded

    });