[CLOSED] How to change specific column name of Grid dynamically?

  1. #1

    [CLOSED] How to change specific column name of Grid dynamically?

    How to change specific column name of Grid dynamically?
    Last edited by Daniil; Jun 06, 2013 at 7:40 AM. Reason: [CLOSED]
  2. #2
    Hi @alscg,

    Please clarify what exactly do you mean under "column name": its Text or DataIndex?
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @alscg,

    Please clarify what exactly do you mean under "column name": its Text or DataIndex?
    It is Text ...
  4. #4
  5. #5
    Quote Originally Posted by Daniil View Post
    Thank you ...I am able to change grid column text using below code. Please let me if there is any better way do this. I did not use column index as we are using reorder of columns functionality for Grid

     Ext.onReady(function () {
            var grid = App.grdTextView;
            var columns = grid.getView().getHeaderCt().getGridColumns();
            Ext.each(columns, function (col) {           
                if ( col.text== "Region") {
                    col.setText("Region Test");
                }           
            });        
        });
  6. #6
    It might be better to access columns by its ItemIDs.

    <ext:Column 
        ItemID="Column1" 
        runat="server" 
        Text="Test" 
        DataIndex="test" />
    App.GridPanel1.getView().headerCt.child("#Column1").setText("New Text");
  7. #7
    Quote Originally Posted by Daniil View Post
    It might be better to access columns by its ItemIDs.

    <ext:Column 
        ItemID="Column1" 
        runat="server" 
        Text="Test" 
        DataIndex="test" />
    App.GridPanel1.getView().headerCt.child("#Column1").setText("New Text");
    Yes...this is better solution. Thanks.

Similar Threads

  1. [CLOSED] How to select specific record's checkbox column in grid?
    By alscg in forum 2.x Legacy Premium Help
    Replies: 8
    Last Post: Apr 08, 2013, 7:44 AM
  2. Replies: 3
    Last Post: Aug 01, 2012, 6:51 PM
  3. 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
  4. Replies: 1
    Last Post: May 19, 2010, 5:07 PM
  5. [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

Posting Permissions