Jqgrid sorts numbers as strings.

when the ID column format in the database is string,
and sorted using jqGrid, the sort by ID becomes the sorting mode of the following figure,

Baidu did not find a suitable solution for a while.

Mar.01,2021

adding sorttype:'integer' sorting to colModel makes it normal


this is the string sorting problem. Use sort ((a, b) = > a-b) to implicitly convert to numeric comparison to try sorting

Menu