I’m using jqgrid on a page and I’m trying to persist column sorting between sessions. The issue is that when I call sortGrid upon trying to get the column that was previously sorted to sort on page load, it doesn’t quite work. I get the relevant (asc/desc) icon on the correct column but the data itself is not sorted.
I have put some logs inside the jqgrid code itself and the data that I’m passing is the same as gets passed when a column header is clicked.
Any ideas on this? Thanks in advance for any help!
This turned out to be an issue relating to not firing reloadGrid on the jqgrid object. The data was being added to the page but reloadGrid not being called, for some reason even sortData().trigger(‘reloadGrid’) wouldn’t work but placing a reload on the grid after adding the data and before calling sortData() fixed the issue.