Jun 29, 2011, 7:46 AM
[CLOSED] Trying to dynamically change grid panel columns.
HI
I'm trying to make changes to a Grid Panel's Column Model/Columns using Javascript at runtime, here my latest, unsuccessful attempt:
thanks
I'm trying to make changes to a Grid Panel's Column Model/Columns using Javascript at runtime, here my latest, unsuccessful attempt:
var colMod = new Ext.grid.ColumnModel({
defaults: {
width: 120,
sortable: true,
hidden: false
},
columns: [
{ id: 'masterAccountId', header: 'Master Account Id', width: 20, dataIndex: 'MasterAccountId', hidden: true },
{ id: 'masterAccountNo', header: 'Master Account No.', dataIndex: 'MasterAccountNumber' },
{ id: 'masterAccountName', header: 'Account Name.', dataIndex: 'MasterAccountNumber' }
]
});
searchResultsGridPanel.colModel.destroy();
searchResultsGridPanel.colModel = colMod;
searchResultsGridPanel.render();
These new columns should be applied and visible before the user carries out a Store load for the grid. Unfortunately, I cannot seem to 'apply' the new column model/columns to the grid. As you can see I have tried render(), to no avail.thanks
Last edited by Daniil; Jul 11, 2011 at 9:22 AM.
Reason: [CLOSED]