Descending Sort not reflecting in UI

5 posts, 0 answers
  1. Mark
    Mark avatar
    4 posts
    Member since:
    Feb 2016

    Posted 01 Sep Link to this post

    I have a grid and I've created a custom compare routine for one of the columns. When I click the header (sorting ascending) the data is sorted and the UI reflects the newly sorted ordering. I can tell that my compare method is being called and since the sort order is correct, that it is correct. When I click the header again, while I see that the compare method is called, and it is returning the correct values, the UI does not update to reflect the descending sort ordering. There are no javascript errors reported, so I am at a loss - it seems that all the parts are working except that the UI is not updating properly.

    If anyone has any ideas on things I can check and/or try, I'd appreciate your help.

  2. Mark
    Mark avatar
    4 posts
    Member since:
    Feb 2016

    Posted 01 Sep in reply to Mark Link to this post

    When I remove the compare function specification (use out of the box sorting for the field) the descending sort works (other than the fact that it's not reflecting what we need)
  3. Kendo UI is VS 2017 Ready
  4. Stefan
    Admin
    Stefan avatar
    264 posts

    Posted 05 Sep Link to this post

    Hello Mark,

    This is not a known issue, and it was not reproducible in my testing scenarios.

    I can assume that due to the custom compare function the data is not updated before the Grid starts re-rendering.

    I can suggest manually re-rendering the Grid using its refresh method:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-refresh

    If this does not help, could you please send a runnable example that reproduces the issue so I can investigate further.

    Regards,
    Stefan
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  5. Mark
    Mark avatar
    4 posts
    Member since:
    Feb 2016

    Posted 06 Sep in reply to Stefan Link to this post

    I have a dojo that displays the incorrect sorting results for me: http://dojo.telerik.com/@mcdoma2000/eJubO/8

    And a screen cast that shows what I see: http://www.screencast.com/users/mcdoma2000/folders/Default/media/3f9bc502-3aab-4435-bc18-4378d46840ea

    I see this result in IE 11, Firefox and Chrome.

  6. Mark
    Mark avatar
    4 posts
    Member since:
    Feb 2016

    Posted 06 Sep in reply to Mark Link to this post

    RESOLVED! I received a message from support noting that my compare function was not correct. I assumed that since there is a parameter passed to the compare function named "descending" that I had to handle it in the code. Apparently the grid will pass the values in the appropriate position to get either ascending or descending. The only value to that field, then, appears to be for stable sorts in this link: http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/stable-sort-chrome

    At any rate, it is working for me now.

Back to Top
Kendo UI is VS 2017 Ready