PDA

View Full Version : dynamic ColumnModel



brunnolou
2 May 2007, 3:53 AM
how can I dynamic load an array to a ColumnModel
I want to dynamic load the LoadArray variable from a file




var LoadArray = [
{header: "Company", width: 260, sortable: true, locked:false, dataIndex: 'company'},
{header: "Price", width: 75, sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
{header: "Change", width: 75, sortable: true, renderer: change, dataIndex: 'change'},
{header: "% Change", width: 75, sortable: true, renderer: pctChange, dataIndex: 'pctChange'},
{header: "Last Updated", width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
];
// I want to dynamic load this variable from a file
var colModel = new Ext.grid.ColumnModel(LoadArray);


is possible? thank you

jsakalos
2 May 2007, 4:06 AM
If you want to change column model of existing grid look in source for the (undocumented) method reconfigure.

tryanDLS
2 May 2007, 6:45 AM
What is your file going to contain? A javascript array declaration, a bunch of text?

brunnolou
2 May 2007, 9:10 AM
What is your file going to contain? A javascript array declaration, a bunch of text?

json