PDA

View Full Version : add a new column to a grid dynamically



coloradocanyon
27 May 2014, 10:56 PM
Hello,

I want to add a new column to a grid dynamically, as is done?

greetings and thanks .... :)

Kachopsticks
5 Jun 2014, 5:25 AM
You will want to do something like this.



this.getColumnModel().config.push(new Ext.grid.Column({
id: Ext.id(),
dataIndex: 'myNewColumnDataIndex',
header: 'My New Column',
renderer: function(val, metadata, record, rowInd, colInd, store){}//provides a way of manipulating data that is going into your column
}));

cgi-bin
9 Jun 2014, 12:46 PM
This covers it pretty well...
http://www.sencha.com/forum/showthread.php?53009-Adding-removing-fields-and-columns