PDA

View Full Version : add column to an existing grid



Stephan123
9 Oct 2009, 4:06 AM
Hello !

I have an grid with 1 column.


var fenster = new Ext.Window({
title: 'Testfenster',
width: 600,
height: 400,
items: [{
xtype: 'grid',
title: 'Tabelle',
width: 400,
autoHeight: true,
id: 'tabelle',
columns: [
{header: 'Id', dataIndex: 'id'}
],
store: store
}]
}); // Ende Fenster

Now i call the database and i became the information that the grid has more columns.
How can i add columns to an grid and how can i modify the Ext.data.JsonStore ?

Your sincerly

Stephan

Condor
9 Oct 2009, 4:15 AM
You can either make your server send the field and column info with your data (example (http://www.extjs.com/forum/showthread.php?p=371353#post371353)) or add/remove fields and columns yourself (example (http://www.extjs.com/forum/showthread.php?t=53009)).