Results 1 to 2 of 2

Thread: Problem with modifying store for GridPanel

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Vote Rating

    Default Problem with modifying store for GridPanel

    Hi All,

    I have setup a gridpanel by using simplestore by using the EXT.onready method.

    I had created my store as:

    myData = [['xc','y','z','a','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','a','']]; storeModGenericList_30 = new{ 
      autoLoad:true,fields: [ 
    {name:  'col0'},{name: 'col1'},{name: 'col2'},{name: 'col3'},{name:  'col4'},{name: 'col5'},{name: 'col6'},{name: 'col7'},{name:  'col8'},{name: 'col9'},{name: 'col10'},{name: 'col11'},{name:  'col12'},{name: 'col13'},{name: 'col14'},{name: 'col15'},{name:  'col16'},{name: 'col17'},{name: 'col18'},{name: 'col19'},{name:  'col20'},{name: 'col21'},{name: 'col22'},{name: 'col23'},{name:  'col24'},{name: 'col25'},{name: 'col26'},{name: 'col27'},{name:  'col28'},{name: 'col29'},{name: 'col30'},{name: 'col31'},{name:  'col32'},{name: 'col33'},{name: 'col34'}    ] 
    After user performs some operations on the page, I am modifying the gridpanel without refreshing the page.
    The user operations results in addition of more fields to store above and I load the modified data again by using the following code:
    After that I am hiding empty columns using a for loop over the grid columns by using columnmodel.

    The problem I am facing is that when I reach the end of loop and try to show/hide the last column (which is the newly added column), a javascript error is returned and page gets refreshed.

    Does the re-loading of fresh data to store not automatically add extra column in the gridpanel. Here is how I am performing show/hide operation:
    window['grid'+divId].getColumnModel().setHidden(j, false);
    Any help would be greatly appreciated.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    The columns are predefined and are not run based on the fields on the store. If you want to add more columns to a grid, you should use the reconfigure method on the grid.
    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

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