jqGrid's sort icon on the column header shows both up and down arrows. Is there a way to force the icon to show only 1 direction like only allowing ascending order?
Thanks.
jqGrid's sort icon on the column header shows both up and down arrows. Is there a way to force the icon to show only 1 direction like only allowing ascending order?
Thanks.
Check out the jqGrid Event documentation here. You could define your own sorting by returning
'stop'
on theonSortCol
event. Something like this should work:Also if you do this on gridComplete it should hide the descending arrows:
In the answer I shown how to change the visibility of sorting icons. I modified for you the previous solution to show only the active sorting icon.
The demo demonstrate the results and shows the headers like this:
or this:
The code below shows the most important part of the code:
I tried to use
$icons.find('>span.ui-icon-asc').show();
in theonSortCol
at the beginning , but has problems in the Google Chrome because the show() setdisplay: block
style on the<span>
element. So I just removed thedisplay: none
style.