PDA

View Full Version : Grid reconfigure



psmacarov
28 Jan 2010, 11:19 PM
How i can reconfigure the grid
I change Column Model
var columns = Ext.getCmp('?-grid').colModel.columns;
if(cm){
var cs = [];
for(var i = 0, len = cm.length; i < len; i++){
cs.push(columns[cm[i]]);
}
columns = cs;
}
Ext.getCmp('?-grid').colModel.columns = columns;

And now I whant to reload grid with such Column Model

I try it with this code

Ext.getCmp('?-grid').reconfigure(Ext.getCmp('?-grid').store,Ext.getCmp('?-grid').colModel);

But nothing happens, Anybody help me, i an novice at ExtJs, and don't understand how reload grid

polinux
29 Jan 2010, 6:50 AM
I don't understand the line :
cs.push(columns[cm[i]]);

I should prefer
cs.push(cm[i]);

Would you try this :
gp = Ext.getCmp('?-grid');
gp.reconfigure(gp.store, cm);
gp.store.load( );