This is a migrated thread and some comments may be shown as answers.

Descending Sort not reflecting in UI

4 Answers 429 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 01 Sep 2016, 03:37 PM

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.

4 Answers, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 01 Sep 2016, 03:52 PM
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)
0
Stefan
Telerik team
answered on 05 Sep 2016, 12:52 PM
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.
 
0
Mark
Top achievements
Rank 1
answered on 06 Sep 2016, 12:20 PM

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.

0
Mark
Top achievements
Rank 1
answered on 06 Sep 2016, 03:14 PM

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.

Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or