ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: janvsc on August 12, 2014, 07:48:31 am

Title: Date not sorting correctly
Post by: janvsc on August 12, 2014, 07:48:31 am
Hi,

I am sending a date (JSON)  to pgdgrid in the following format: DD/MM/YY and the column is defined as { title: "Date", width: 70, dataType: "date", align: "right" }
The date is displayed correctly but when I click on the column header to sort, the column is sorted as MM/DD/YY

How do I correct this?

Regards

Jan
Title: Re: Date not sorting correctly
Post by: paramvir on August 12, 2014, 10:37:14 pm
Jan

It's because the grid doesn't understand the dd/mm/yy format.

For correct sorting and filtering, you need to format the date as yyyy/mm/dd or mm/dd/yy in JSON data while you can still display the date as dd/mm/yy in the view using column.render callback.
Title: Re: Date not sorting correctly
Post by: janvsc on August 13, 2014, 04:19:18 am
Thank you for the quick response

All good now