1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    4
    Vote Rating
    0
    jmei is on a distinguished road

      0  

    Default Default sort direction of data store in grid

    Default sort direction of data store in grid


    Hi there,

    Is there any way of specifying the default sort direction (ASC or DESC) of the data in a grid when the user clicks on a column header in the grid? Right now it's defaulting to ASC but I want it to default to DESC when the user clicks the column header.

    Thanks a bunch.

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    From the doc - setDefaultSort

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    4
    Vote Rating
    0
    jmei is on a distinguished road

      0  

    Default


    Didn't work. Still sorts ascending when I click on the column header. I need to click the header twice for it to sort by descending order. setDefaultSort just sorts it right off the bat doesn't it?

  4. #4
    Ext User
    Join Date
    Jun 2007
    Posts
    5
    Vote Rating
    0
    hceline is on a distinguished road

      0  

    Default


    I'm having the same problem... I suspect this is very easy, but I can't find it anywhere in the documentation.

  5. #5
    Ext User
    Join Date
    Mar 2007
    Posts
    4
    Vote Rating
    0
    jmei is on a distinguished road

      0  

    Default


    Perhaps there's a way to capture the click event of the grid header and call the sort, but I'm not sure where to get that either.

  6. #6
    Ext User
    Join Date
    Jun 2007
    Posts
    5
    Vote Rating
    0
    hceline is on a distinguished road

      0  

    Default


    It's probably not too hard to hack something like that together, but I would've thought that this was something pretty standard and that there was some way of setting it.

  7. #7
    Ext User
    Join Date
    Jun 2007
    Posts
    5
    Vote Rating
    0
    hceline is on a distinguished road

      0  

    Default


    datastore.setDefaultSort('col1', 'desc');

    does what I want for one column, but only one. Setting default sort for another column overrides the first (ie. there is only one default sort).

  8. #8
    Ext User
    Join Date
    Aug 2007
    Posts
    3
    Vote Rating
    0
    cunami is on a distinguished road

      0  

    Default


    Quote Originally Posted by jmei View Post
    Hi there,

    Is there any way of specifying the default sort direction (ASC or DESC) of the data in a grid when the user clicks on a column header in the grid? Right now it's defaulting to ASC but I want it to default to DESC when the user clicks the column header.

    Thanks a bunch.
    Hi!

    did you found any solution for this problem? I am having here similar problems like yours...

    Thanks!
    Cunami

  9. #9
    Ext User
    Join Date
    Sep 2007
    Posts
    1
    Vote Rating
    0
    vanger is on a distinguished road

      0  

    Default


    see this from the Docs: config-sortInfo

  10. #10
    Ext User
    Join Date
    Jun 2007
    Posts
    27
    Vote Rating
    0
    spacyspacy is on a distinguished road

      0  

    Default


    Quote Originally Posted by vanger View Post
    see this from the Docs: config-sortInfo
    This applies only to the loading sort of the grid, not the column header click sorts.

    Anyone has found a solution for this problem?