Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Klaus Kohlschuetter on May 20, 2009 23:52
open dhtmlx forum
Sorting columns with date format

Hi,

I'm using the pro version of dhtmlx and I'm look for a sorting solution of columns with a date. Following an example I have set the celltype to "ro" and sort to "date". Using a date format "m/d/y" or "m/d/Y" sorting goes well. So, what I need is a date format like "d.m.y" or "d.m.Y". If I set this format to my column, the sorting algorithm does not work anymore. Now I have two options: the content of my database is a UNIX-timestamp (int=10). This is the most effective way to sort tables within MySQL. I can add a column to my grid with this values (hidden). Is there an opportunity to sort a different column clicking on the date header line? or using the original column, how can I sort these items without using dhxCalendar or dhxCalendarA (this takes to much time).

Thx
Answer posted by Support on May 21, 2009 01:49
a) you can use dhxCalendar column type and setDateFormat method - which will allow to show data in custom format and still able to sort it correctly

b) you can provide hidden column with necessary data ( or use row attributes to store the same data ) and use custom sorting function which will use it for sorting
Please chech "Predefined sorting order" at 
http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Sorting_in_grid.html#grid_art_sort