Forum


17:04

03/06/2009

Hi,
I'm trying to get jQuery Grid to sort by date, but it doesn't seem to work.
This line:
{name:'RecDate',index:'RecDate',width:350,sorttype:"date",datefmt:'mm/dd/yyyy'}
sorts by month, then by day, then by year. The date is displayed from MS SQL by: CONVERT(VARCHAR(12), d.RecDate, 101) AS RecDate,
This gives it the format of 'MM/DD/YY'
How do I get it sort the dates from oldest to newest?
Thanks - Mike
05:00

Moderators
30/10/2007

Hello,
The date string from grid is allways converted to javascript date object, so you never get a chance to sort first by month then by day and the by year (if I understand right).
Try with sorttype:'text'
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
01:56

Moderators
30/10/2007

Hello,
Try with datefmt:mm/dd/yy
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
09:00

Moderators
30/10/2007

Hello,
If it is possible could you please send me a link to the problem.
My e-mail is tony at trirand dot com.
Thanks
Best Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
32 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66