1. #1
    Sencha User
    Join Date
    Oct 2009
    Posts
    21
    Vote Rating
    0
    strimp099 is on a distinguished road

      0  

    Default Conditional Sort Direction in GroupingStore

    Conditional Sort Direction in GroupingStore


    Greetings,

    I have a GroupingStore first grouped by field Alpha. Alpha contains one of two string values: A or B. Within each of these two groups (A and B), there are records to be sorted by a second field Beta. Beta contains numerical data.

    I'd like to do a conditional sort so that the records in group A are sorted in ascending order and the fields in group B are sorted in descending order (see table example below).

    Alpha Beta
    A
    1
    2
    3
    4
    B
    10
    9
    8
    7



    I've looked through the DOM of the rendered GroupingStore as well as the documentation and there of course are properties that give me the string name of the sort field (Beta), but I've yet to find a way to access the actual string value of the given group to write a conditional statement that sets the sort order of the records within that group.

    Any thoughts on how to conditionally change the direction of the sort based on the group?

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,075
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    One thought is to return the in the preferred secondary sort order from the server to get this to work.

    Regards,
    Scott.

Thread Participants: 1

Tags for this Thread