Results 1 to 4 of 4

Thread: How to Remove the custom sorters applied on grid columns on grid reload?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    42
    Answers
    1
    Vote Rating
    3
      0  

    Default How to Remove the custom sorters applied on grid columns on grid reload?

    On grid reload, how to remove the custom sorters applied on grid columns ? we tried to remove the store sorters on grid render(bad practice).

    I hope there is already a solution provided in ext js new versions, to remove the sort icons on grid columns when it is reopened/reloaded.

  2. #2
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Answers
    32
    Vote Rating
    89
      0  

    Default

    Does this work for you?

    PHP Code:
    grid.getStore().sorters.clear();
    grid.getView().refresh(); 
    Here's a live example of it: http://jsfiddle.net/existdissolve/vVSWT/

  3. #3
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    42
    Answers
    1
    Vote Rating
    3
      0  

    Default

    in my case when reloading the grid, the grid view is not refreshing . if we removed the sorters on grid reload grid will be loosing the sorters defined in store right?

  4. #4
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Answers
    32
    Vote Rating
    89
      0  

    Default

    Yeah, I believe if the store still retains the sort, the grid will inherit the current sorting state of the store, since the sorting on the grid is driven by the store.

    So, if you reload the grid, you could add a listener to the render event and clear the bound store's sorters at that point:

    PHP Code:
    mygrid.on'render',function( gridopts ) {
        
    grid.getStore().sorters.clear();
    }) 

Posting Permissions

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