Changing default collation to jqgrid

Perhaps there is a quick solution, but I could not find it ....

I want to change the default sort when I click on the column heading from 'asc' to 'desc',

I tried to add this code, it changed the sort direction, but still the arrow icon is the opposite:

onSortCol: function (index, columnIndex, sortOrder) { sortOrder = (sortOrder == 'asc' ? sortOrder = 'desc' : sortOrder = 'asc'); jQuery("#grid").setGridParam({ sortorder: sortOrder }) } 

any ideas?

Thanks!

+4
source share
1 answer

You should use firstsortorder:'desc' in the definition of each colModel column.

+5
source

Source: https://habr.com/ru/post/1342497/


All Articles