Results 1 to 6 of 6

Thread: Grid Grouping Sorting

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    12
    Answers
    1
    Vote Rating
    0
      0  

    Default Grid Grouping Sorting

    Hello, so I have a grid with 4 groups. However, I do not want the groups to be sorted. So lets say my store is structured as follows and i am grouping by the first element:
    var dataStore = [
    [0,1,2,3],
    [2,1,2,3],
    [3,1,2,3],
    [1,1,2,3]
    ];

    The grid will show up with the groups 0,1,2,3 in that order. I do not want this to happen, i want it to group in the order 0,2,3,1, the way the array is structured. Is this possible?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    If a store is grouped it will automatically sort the store on the group

    Code:
            if (me.groupers.items.length) {
                me.sort(me.groupers.items, 'prepend', false);
            }
    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
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    12
    Answers
    1
    Vote Rating
    0
      0  

    Default

    where does this if statement go? store listener?

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    No... that is the code controlling the sorting in the store.
    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
    https://github.com/mitchellsimoens

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
  •