1. #1
    Ext JS Premium Member
    Join Date
    May 2011
    Posts
    23
    Vote Rating
    0
    awhiteho is on a distinguished road

      0  

    Default Answered: Grid Column Sorting Question

    Answered: Grid Column Sorting Question


    I've got an app where I'm loading data into a grid in a certain sort sequence based on different search fields the user can specify. This is done using the Order By on the sql when retrieving the data from the Db.

    Once the data is loaded into the grid the user can re-sort the data by clicking on a column header.

    My problem is this, if the user performs another search I want the sort to revert back to the sort sequence before they clicked on a grid column.

    I assumed the headerCt.clearOtherSortStates(null , true); would do what I was looking for. This does clear graphic arrow on the column header that was clicked but when the grid's reloaded it still retains the sort sequence of the clicked column.

    Any help would be appreciated

  2. You need to clear the sorting on the store, the grid reflects the sorting on the store

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    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


    You need to clear the sorting on the store, the grid reflects the sorting on the store
    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.

  4. #3
    Ext JS Premium Member
    Join Date
    May 2011
    Posts
    23
    Vote Rating
    0
    awhiteho is on a distinguished road

      0  

    Default


    Hi Mitchell,

    This is probably a stupid question but not sure how to clear the sorting on the store.

    Within the store definition I don't specify any sort fields, the sql order by is controller the sequence of the data initially coming in.

    I looked thru all the methods for a store & wasn't sure which 1 would clear the sorting.

    Thanks

  5. #4
    Ext JS Premium Member
    Join Date
    May 2011
    Posts
    23
    Vote Rating
    0
    awhiteho is on a distinguished road

      0  

    Default


    Looks like I was over complicating things. All I had to do was add sortOnLoad : false in the store definition.

    Thanks

Thread Participants: 1