问题描述:

I am trying to sort the email column using JqGrid, but it is behaving inconsistently.

For example, if my grid is below

Name Phone Email

-------------------------------

Name A 123456 ABCDEFG

Name B 654321 [email protected]

Name C 987456 PETER.WI

If i am trying to sort the above grid by using Email column it is not giving expected output, instead it is giving output like below if I am trying sort in ascending order.

Name Phone Email

-------------------------------

Name C 987456 ABCDEFG

Name B 654321 PETER.WI

Name A 123456 [email protected]

My guess is JqGrid not working for column which is containing @ symbol.

网友答案:

Don't forget to set the sorttype of the column:

sorttype: "string"

(or at least make sure you don't put there int/float).

Here is a working example:
http://jsfiddle.net/vvz2a3cy/

相关阅读:
Top