My jqgrid has an amount column which has custom formatting applied and the result can be the amount itself, or special characters (for eg: *, "", NA, image). All the special characters are needed as it describes the kind of amount. (for eg: * means user is not authorized to see the amount)
My challenge is how do I sort this.
Below is my column model for the amount column.
[name: 'amount', index: 'amount', type: "String", align: "right", sorttype: "float", title: false, formatter : someCustomFormatterFunction]
For example: Suppose my amount data was something like this [100, 180, 120, 130, 160] However after custom formatting this changed to [100, *, image, 130, NA] My sorttype is "float". Because requirements was initially for amounts only. But updated requirements introduced these special characters.
Now, on sorting, i should see all the special characters together and numbers together. Something like [100, 130, *, image, NA] or [*, image, NA, 100, 130] for ascending order.
But, I am getting it as [100, image, 130, NA, *]. I can understand why I am getting like this.
How can I achieve sorting in a proper way.
Also, next step would be to sort the special characters also in a specified order. All my thoughts are taking me to implement some ugly big logic. Is there any ideas on how to implement this.
Thanks, Sam