Results 1 to 6 of 6

Thread: Grid Grouping Issue (2+3) : sortProperty and sorterFn

    You found a bug! We've classified it as EXTJS-15076 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Jun 2014
    Posts
    27

    Default Grid Grouping Issue (2+3) : sortProperty and sorterFn

    In grid grouping despite the documentation the sortProperty and the sorterFn function of any grouper seems to be ignored. Have a look at fiddle https://fiddle.sencha.com/#fiddle/6nc and https://fiddle.sencha.com/#fiddle/6nd for the sortProperty and the sorterFn and play with the order values. The group order in the grid won't change despite the fact that at least for the latter sorterFn is being called to internally identify a group order.

    This problem has been verified in FF30.
    Last edited by Moritori; 16 Jun 2014 at 1:08 PM. Reason: Browser Information Added

  2. #2

    Default

    Have exactly the same problem. Verified in IE11.

  3. #3
    Sencha Premium Member
    Join Date
    Jun 2014
    Posts
    27

    Default

    I've seen that this report is now open for a longer period of time but hasn't been classified as a bug yet. Do you need more information to get this problem classified as an internal bug?

  4. #4
    Sencha Premium Member
    Join Date
    Jun 2014
    Posts
    27

    Default Further information

    I come back with a little bit more information on this topic with a working fiddle running on version 4.2.1 (https://fiddle.sencha.com/#fiddle/8m7) and another failing on version 5.0.1 (https://fiddle.sencha.com/#fiddle/8m6).

    I was able to track down a little bit more the reason of this problem:
    • In version 4.2.1 the method Ext.data.Store.getGroups() returns a correctly ordered list of groups and their children,
    • while in version 5.0.1 the method Ext.data.Store.getGroups().getRange() returns an unsorted list of Ext.util.Group instances

    Therefore the groups in grids are wrongly sorted but according to the order returned by Ext.data.Store.getGroups().getRange()

  5. #5
    Sencha Premium Member
    Join Date
    Nov 2012
    Posts
    22

    Default

    Hi,

    I have the same issue. Is there a workaround or bugfix we can apply?

    Thanks,
    Dan

  6. #6
    Sencha Premium Member
    Join Date
    Jun 2014
    Posts
    27

    Default

    I've found a really dirty workaround for this that might help in desperate situations: provide a groupFn function that generates the final value that you want to sort by. For numeric values, you have to add some big number e.g. 1000 before returning. Reason is that actually 14 < 2 (according to the internal search function applied), but 1002 < 1014. Don't forget to subtract 1000 in your grouping feature rendering, if this groupValue was actually some model index.

    This workaround does, what it should do, but it does definitely NOT (!) solve this very problem. We really need a sophisticated general solution, but from what I've seen in the code, this will most likely take quite some time.
    Last edited by Moritori; 29 Sep 2014 at 1:37 PM. Reason: TYPO

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
  •