FlexGrid.collectionView 's Sort algorithm is not so right

Posted by: frhave on 18 December 2017, 3:10 pm EST

    • Post Options:
    • Link

    Posted 18 December 2017, 3:10 pm EST

    There are two problems in FlexGrid.collectionView 's Sort algorithm:

    1. in FlexGrid, the null value always show in the last whether sort by asc or desc, this is not the same as sqlserver, in SqlServer, the null is the minimum value, it will show in the first when sort by asc.

      2.For CJK char, the FlexGrid’s sort algorithm is not right, it sort by unicode value, it is uselesss for CJK users.

      the result is not right and is not the same as Sqlserver.

      For CJK char, the right way is to use Intl.Collator to sort, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator

    So, the best way is to to make te Sort member to public, so user can override it

    to change the sort algorithm by himselft.

    thanks.

  • Posted 19 December 2017, 6:18 am EST

    Hi,

    CollectionView class expose sortComparer and sortConverter method for the same purpose. You may override the sorting as per need.

    Documentation:

    http://demos.wijmo.com/5/Angular/WijmoHelp/WijmoHelp/topic/wijmo.collections.CollectionView.Class.html

    Please refer to the following post where the same issue has been discussed.

    https://www.grapecity.com/en/forums/wijmo/sorting-issue-of-null-valu

    ~Manish

  • Posted 19 December 2017, 9:15 am EST

    I see, sortComparer and sortConverter is the right way to resolve the problem, thanks!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels