Results 1 to 7 of 7

Thread: [Ext6.5.2 Classic]How to change the text of a column in all gird?

  1. #1
    Sencha Premium User
    Join Date
    Jun 2017
    Location
    China
    Posts
    35
    Answers
    1

    Default Answered: [Ext6.5.2 Classic]How to change the text of a column in all gird?

    I hava a tabPanel.There is many grid in it.
    I want to change all the columns text 'oldDemo' into 'newDemo' in my all grid. Is there any suggestion?

  2. Hi MingPan,
    don't we have the good old method reconfigure http://docs.sencha.com/extjs/6.5.2/c...od-reconfigure for such purposes? You can pass in your new column name by getting the actual column list with
    Code:
    getColumns
    , change the desired column for the grid and then call the 'reconfigure' method by passing your modified column array to the grid. If you have a controller on the layer of the tabPanel, give each grid a reference property to be able to do a lookup in the controller by 'lookupReference("myFirstGrid")' and then get the columns, modify them and reconfigure (both) grid(s).

  3. #2
    Sencha User timriedel's Avatar
    Join Date
    May 2008
    Location
    Karlsruhe, Germany
    Posts
    23
    Answers
    2

    Default

    Have you got a code example?
    Use the scope, Luke.

  4. #3
    Sencha Premium User
    Join Date
    Jun 2017
    Location
    China
    Posts
    35
    Answers
    1

    Default

    hi timriedel,
    it should be looks like this :https://fiddle.sencha.com/#fiddle/2arj&view/editor
    However,I want to change the column text for all grid that column text is 'oldDemo' to 'newDemo' before load. Thanks!

  5. #4
    Sencha User timriedel's Avatar
    Join Date
    May 2008
    Location
    Karlsruhe, Germany
    Posts
    23
    Answers
    2
    Use the scope, Luke.

  6. #5
    Sencha Premium User
    Join Date
    Jun 2017
    Location
    China
    Posts
    35
    Answers
    1

    Default

    Thanks for your reply. I have a tabpanel.There is two grid panel in it. The two grid panel have the same column 'oldDemo', I want to change column text of the two grid panel.Have you any suggestion?

  7. #6

    Default

    Hi MingPan,
    don't we have the good old method reconfigure http://docs.sencha.com/extjs/6.5.2/c...od-reconfigure for such purposes? You can pass in your new column name by getting the actual column list with
    Code:
    getColumns
    , change the desired column for the grid and then call the 'reconfigure' method by passing your modified column array to the grid. If you have a controller on the layer of the tabPanel, give each grid a reference property to be able to do a lookup in the controller by 'lookupReference("myFirstGrid")' and then get the columns, modify them and reconfigure (both) grid(s).

  8. #7
    Sencha Premium User
    Join Date
    Jun 2017
    Location
    China
    Posts
    35
    Answers
    1

    Default

    Thank you very much. I solved this problem with the reconfigure method.

Similar Threads

  1. Ext6.5.1 Classic:Buttons inside a menu get resized after first visit
    By Nagarjuna.Borra in forum Ext JS 6.x Bugs
    Replies: 5
    Last Post: 12 Oct 2017, 12:19 AM
  2. Replies: 0
    Last Post: 22 Feb 2017, 3:22 AM
  3. Replies: 1
    Last Post: 29 Jan 2017, 11:21 PM
  4. gird sub header change text
    By zlevardy in forum Ext: Q&A
    Replies: 2
    Last Post: 28 Feb 2013, 1:02 AM
  5. show gird column value in a text box
    By ragendu in forum Ext: Q&A
    Replies: 5
    Last Post: 4 Mar 2012, 11:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •