I am using JQGrid to store the data which is being loaded on the client side itself. I want sort the date which is in a customized format(i.e. 11-Nov-2010). I want to sort it on the client side (due to the requirement). Can anyone of you suggest me what I need to do?
Thanks in Advance!
With Regards
Phani Kumar
jqGrid support date formatter. It allows to display the date in the grid in the format which you prefer. You need only the choose the corresponding formatter option like
sorttype:'date', formatter:'date', formatoptions: {newformat:'d-M-Y'}
So you can fill the grid in one format (default format form is ISO Date format Y-m-d and I recommend you to use this format). You can also use Date
type as input for the local data. The option newformat
define the format of data which will be displayed for the user. Internally the date will be hold and sorted as the Date
JavaScript type.
To make easy to use practically what I explained above I created small demo example which you can see live and examin it's JavaScript code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With