Hi
I have a request to change the behaviour of the sorting feature on our grids.
What the user would like is to have the following behaviour:
rather than having to press shift click.
What would be the recommended approach to achieve this?
Regards
Aidan
Hi Aidan,
You can use the firstSortDirection property and then handle the columnSorting event. The whole code will look like this:
features: [ { name: "Sorting", firstSortDirection: "descending", columnSorting: function (evt, ui) { if((ui.owner.option("firstSortDirection") == ui.direction) && ui.owner.grid.dataSource.settings.sorting.expressions.length != 0) { ui.owner.clearSorting(); return false; } } }
This code will execute when user tries to sort a column for third time as the provided scenario. The clearSorting method removes the current sorting(for all sorted columns) and updates the UI.
Please be aware that this will only work for 15.1. Let me know if you use lower version of IgniteUI so that I can modify my code accordingly.
Hi Hristo,
Thanks for the reply.
Sorry forgot to add the platform info, we are on 14.2 with plan to move to 15.1 but not immediately. If you have a solution for 14.2 that would be great.