1. #1
    Sencha User
    Join Date
    May 2009
    Posts
    6
    Vote Rating
    0
    Selvatico is on a distinguished road

      0  

    Default Ext Js 4 Grid Reconfigure on a fly

    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 - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,777
    Vote Rating
    112
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      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
    73
    Vote Rating
    1
    AlxH is on a distinguished road

      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
    Selvatico is on a distinguished road

      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
    73
    Vote Rating
    1
    AlxH is on a distinguished road

      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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    872
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  7. #7
    Sencha - Services Team arthurakay's Avatar
    Join Date
    Sep 2008
    Location
    Antioch, IL
    Posts
    1,374
    Vote Rating
    37
    arthurakay is a jewel in the rough arthurakay is a jewel in the rough arthurakay is a jewel in the rough arthurakay is a jewel in the rough

      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.
    Arthur Kay
    Developer Relations Manager, Sencha Inc.

    Twitter | Sencha Chicago User Group

  8. #8
    Ext JS Premium Member dnorman's Avatar
    Join Date
    Jan 2011
    Posts
    101
    Vote Rating
    54
    dnorman is a jewel in the rough dnorman is a jewel in the rough dnorman is a jewel in the rough

      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

Thread Participants: 5

Tags for this Thread