jqGrid with Custom sorttype

前端 未结 2 1923
抹茶落季
抹茶落季 2020-11-28 16:11

I am using jqGrid 3.7.2 with local data. For some columns the default sorttypes are not sufficient. I need to provide a custom sorttype, which I understand from the document

2条回答
  •  孤街浪徒
    2020-11-28 16:42

    According to this forum post, a custom sorttype is only called when the grid is initialized and not during the onSortCol event:

    As I understand it right now, if I have a custom sorttype like sorttype:sortDate, the function sortDate will only be called when jqGrid is initialized and not the event onSortCol. Is the only way to make onSortcol call SortDate is by manually over riding onSortCol event and writing the tedious code that does this and updates the grid accordingly? Why doesn't defining the sorttype:sortDate just over ride onSortCol event automatically? I mean when the jqGrid gets initailized it sorts correctly, but when I call the event it must do some built in sort. Why I ask is because my sortDate function doesn't have any code that actually updates jqGrid. it just returns 1,-1, or 0. its used in something outside of jqGrid…

    Does this explain the behavior you are seeing?

提交回复
热议问题