I’m using JQGrid 4.4.0 and I would like to override the default behavior for how integers are sorted. I can achieve this by setting the sorttype property of each colModel to a function instead of the literal 'int'.
I’d like to know, though, is there a way that I can make this a global change to my JQGrid configuration, as the example here shows?
What you can do is to use
templateproperty ofcolModelor the usage ofcmTemplateoption of jqGrid to define defaultsorttypeproperty for all columns of the grid. If you would setcmTemplateoption in$.jgrid.defaultsyou will change the defaultsorttypeproperty for all columns of all grids:Look at the answer for more details. For example if you want to define custom sorting like function from the answer