Don't want to show sorting icon for the first time after page load in jqGrid

前端 未结 2 1926
北荒
北荒 2021-01-03 16:55

I am using jqGrid and loading data through JSON. for the very first time when I get the data I sort that using custom method and pass that data to grid. But it always displa

2条回答
  •  走了就别回头了
    2021-01-03 17:01

    The problem could exist if you don't use rownumbers: true or some other options which adds one more first columns in the grid. As a workaround you can use the following option

    lastsort: "0"
    

    It's important to use the value of lastsort as string and not as number (lastsort: "0" and not as lastsort: 0 which is default).

    UPDATED: I posted the pull request which suggest modification of jqGrid code to eliminate the problem which you describe.

    UPDATED 2: The pull request is merged today to the main code of jqGrid on github. So the next version of jqGrid (higher as 4.6.0) which will be published should not have the problem which you described.

提交回复
热议问题