Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Date sorting from MS SQL
02/06/2009
17:04
Avatar
mweezer
Member
Members
Forum Posts: 3
Member Since:
03/06/2009
sp_UserOfflineSmall Offline

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

04/06/2009
05:00
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

04/06/2009
10:40
Avatar
mweezer
Member
Members
Forum Posts: 3
Member Since:
03/06/2009
sp_UserOfflineSmall Offline

Hi Tony,

I don't think I stated the issue correctly.  I need it to sort by chronological order.  Right now it is displaying like this:

1/15/09

2/15/08

3/15/09

It isn't putting the dates in the correct order.

Thanks,

Mike

05/06/2009
01:56
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

08/06/2009
20:12
Avatar
mweezer
Member
Members
Forum Posts: 3
Member Since:
03/06/2009
sp_UserOfflineSmall Offline

Tony,

That causes the grid to not display at all.  Any other ideas? 

Thanks - Mike

09/06/2009
09:00
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information