[CLOSED] Trying to dynamically change grid panel columns.

  1. #1

    [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:

    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]
  2. #2

Similar Threads

  1. I want to change Grid Date column dynamically?
    By mohankumar in forum 1.x Help
    Replies: 0
    Last Post: Feb 15, 2012, 6:42 AM
  2. [CLOSED] How to change grid column values dynamically?
    By Etisbew in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Oct 19, 2009, 2:49 PM
  3. [CLOSED] Change Node Name dynamically in tree panel
    By Etisbew in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jun 29, 2009, 10:49 AM
  4. Replies: 2
    Last Post: Feb 19, 2009, 2:02 PM
  5. Replies: 6
    Last Post: Feb 11, 2009, 3:13 PM

Posting Permissions