开发者

jqgrid sortGrid function

I'm using jqgrid on a page and I'm try开发者_运维百科ing 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜