scottwalter
9 Feb 2012, 6:23 AM
Hi, I am attempting to dynamically add a column to a grid when a button is pressed via:
Ext.create('Ext.Button', {
text: 'Click me',
renderTo: Ext.getBody(),
handler: function() {
cols = grid.columns;
c = new Ext.grid.Column({text:"My Name",width:100,dataIndex:"myname"});
cols.push(c);
grid.reconfigure(store,cols);
}
});
However when the code is executed the all the headers are gone except for the new one and the new column is not added to the grid.
Any ideas on what I am doing wrong?
Ext.create('Ext.Button', {
text: 'Click me',
renderTo: Ext.getBody(),
handler: function() {
cols = grid.columns;
c = new Ext.grid.Column({text:"My Name",width:100,dataIndex:"myname"});
cols.push(c);
grid.reconfigure(store,cols);
}
});
However when the code is executed the all the headers are gone except for the new one and the new column is not added to the grid.
Any ideas on what I am doing wrong?