PDA

View Full Version : unable to load data in store of combobox editor



sukant.sahoo
5 Jul 2012, 5:21 AM
Hi

I have EditorGridPanel.
In column model one column has editor as combo box.
After grid loaded data successfully and clicked on cell which have combo box editor.
First time the combox data loaded successfully. then I reconfiguring grid again by using 'reconfigure' api of EditorGridPanel.
After this when click on the cell which combo box editor the data is not showing.

Please help me.

Thanks & Regards
Sukant

sukant.sahoo
5 Jul 2012, 5:23 AM
please guide me how to reload the data for combo box.
I tried to load manually like put mode in combobox 'local'. and load the store manually.

sword-it
6 Jul 2012, 7:15 AM
Hi,

It's better to test it using your code sample but below would work:



var grid = new Ext.grid.EditorGridPanel({
....
listeners: {

reconfigure: function(grid, store, colModel){

var column = colModel.getColumnById('combocolumn'),
editor = column.editor,
store = new Ext.data.JsonStore({

....

});

//for a new store
editor.bindStore(store);

//for load new data
if(editor.store){

editor.store.loadData(...);

}

}

}
});


If it does not work for you, please provide me a code sample.

Regards.

sukant.sahoo
9 Jul 2012, 9:58 AM
hi,
Thanks for ur reply.
I tried what u suggested but it is not working.
I have written my in below way.

store = new Ext.data.JsonStore({
autoLoad : true,
url :editor.getStore().url,
fields :['textKey','valueKey'],
root:'data'

});

editor = {
xtype:'combo',
alloeBlank:true,
displayField:'textKey'
valueField:'valueKey'
id:'myEditor',
typeAhead:true,
editable:true,
triggerAction:'all',
selectOnFocus:true,
store:store
}

columneModel = new columnModel({
columns:[{
header: 'myheader',
dataIndex: 'light',
width: 70,
editor:editor
}
});

mygrid = new Ext.grid.EditorGridPanel(
{
columns:columns,
store:mystore,
......
});

mygrid .reconfigure(myStore, new Ext.grid.ColumnModel(columns));

is there anyway to update column model with calling reconfigure?

sukant.sahoo
10 Jul 2012, 8:46 PM
is there anyway to update column model without calling reconfigure method?