Results 1 to 8 of 8

Thread: Ext Js 4 Grid Reconfigure on a fly

  1. #1
    Sencha User
    Join Date
    May 2009
    Posts
    6
    Vote Rating
    0
      0  

    Default Ext Js 4 Grid Reconfigure on a fly

    In Ext Js 3 was method reconfigure() to change configuration on a fly. In Ext JS 4 i didn't find such method. Anybody know way to reconfigure grid on a fly ? For example to change tbar, bbar, store etc.

  2. #2
    Sencha Premium User mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,078
    Vote Rating
    184
      0  

    Default

    +1, I'd also be interesed in knowing how you can reconfigure a grid with new "headers" as columns are now called in Ext 4.

  3. #3
    Sencha User
    Join Date
    May 2007
    Location
    Germany
    Posts
    84
    Vote Rating
    1
      0  

    Default

    you can change it by adding and removing headers to the headercontainer.
    its the headerCt property of gridpanel, at least in pr5.
    but they might change it in the next release.
    for example:
    mygrid.headerCt.removeAll();
    mygrid.headerCt.add({xtype:'gridheader',text:'my new column',dataIndex:'col1',width:80});

  4. #4
    Sencha User
    Join Date
    May 2009
    Posts
    6
    Vote Rating
    0
      0  

    Default

    If using this methodic next step will be for my example:
    Ext.getCmp("siteGrid").view.store = anotherStore;
    Ext.getCmp("siteGrid").view.refresh();

    In this way the displaying of grid changed.
    But i think it is dirty way and not always works. I'll test more this...

  5. #5
    Sencha User
    Join Date
    May 2007
    Location
    Germany
    Posts
    84
    Vote Rating
    1
      0  

    Default

    you dont have to "switch" the stores. you can simply change the model of the stores reader with the setModel method. or use the metaData property when the store loads its data...

  6. #6
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Quote Originally Posted by mankz View Post
    +1, I'd also be interesed in knowing how you can reconfigure a grid with new "headers" as columns are now called in Ext 4.
    Not sure why they went to headers instead of leaving it to columns, although it may switch back to columns.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  7. #7
    Sencha User arthurakay's Avatar
    Join Date
    Sep 2008
    Location
    Antioch, IL
    Posts
    1,516
    Vote Rating
    77
      0  

    Default

    Looking in the code (4.0-b3) for Ext.panel.Table (inherited by Ext.grid.Panel), I spy a reconfigure() method that should do the job. It doesn't seem to appear in the documentation, though.

  8. #8
    Ext JS Premium Member dnorman's Avatar
    Join Date
    Jan 2011
    Posts
    101
    Vote Rating
    56
      0  

    Default

    +1
    I'd imagine that this is a fairly common problem. There should be an official way to modify headers/colums.

Similar Threads

  1. Replies: 7
    Last Post: 12 Jan 2010, 1:58 AM
  2. Replies: 1
    Last Post: 10 Nov 2009, 12:00 AM
  3. Replies: 8
    Last Post: 29 Sep 2009, 7:33 AM
  4. Reconfigure Plugins in Grid after calling reconfigure on the grid
    By niaz in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 8 Jul 2009, 3:56 PM

Tags for this Thread

Posting Permissions

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