Sigma Php Ajax framework, Ajax Components, GUI Builder
May 21, 2012, 09:17:01 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Sigma Grid Soring Issue for Date column  (Read 1220 times)
Gowtham
Jr. Member
**
Posts: 11


View Profile
« on: September 10, 2009, 02:28:55 AM »

While sorting the date column in sigma grid, not sorted based on date. It is sorted like string column.

kindly suggest.
Logged
steven
Moderator
Hero Member
*****
Posts: 544



View Profile
« Reply #1 on: September 10, 2009, 02:31:50 AM »

Do a customized sorting. just like
http://www.sigmawidgets.com/products/sigma_grid2/demos/example_customized_sort.html
Logged

Sigma AJAX Data Grid - Easy to Integrate with PHP, ASP Classic, ASP.NET & Java
Sigma PHP Ajax Framework - WYSIWYG GUI Builder With Tree, Grid, Treegrid, Dialog, Tab & More Component
Gowtham
Jr. Member
**
Posts: 11


View Profile
« Reply #2 on: September 10, 2009, 03:13:29 AM »

In this sample, The Score column is not sorting based on score values. please reply.
Logged
steven
Moderator
Hero Member
*****
Posts: 544



View Profile
« Reply #3 on: September 10, 2009, 05:25:35 PM »

Yes, teams which lose more appears before teams lose less. The following code just show you a way to implement your sorting rules.

suppose you have a date with "MM/DD/YYYY" as formate. The code should go like
« Last Edit: September 10, 2009, 05:33:37 PM by steven » Logged

Sigma AJAX Data Grid - Easy to Integrate with PHP, ASP Classic, ASP.NET & Java
Sigma PHP Ajax Framework - WYSIWYG GUI Builder With Tree, Grid, Treegrid, Dialog, Tab & More Component
Gowtham
Jr. Member
**
Posts: 11


View Profile
« Reply #4 on: September 10, 2009, 09:04:27 PM »

Thank you steven
Logged
eWineGuy
Newbie
*
Posts: 1


View Profile
« Reply #5 on: January 19, 2010, 02:10:06 PM »

Perhaps I'm the only one having date sort troubles using your solution, but perhaps others are as well.  When I implement what you suggest, my grid dies and never displays.  Maybe I have a variable naming issue so perhaps a bit more explanation would be helpful.

For the ID named "date", you reference "date_col" in your custom sort script. Is this a reserved word?  I have an ID field named OrderDate.  Do I use (1) "date_col"   (2) "OrderDate_col" or (3) something else? 

I assume the data set Option data type is set to date ... {name : 'OrderDate' ,type: 'date' },

I even changed to use the ID of "date" as per your example and still my grid dies. I remove the custom sort and it's fine.

Comments or assistance welcome!

(newbie)
Logged
dwlovell
Jr. Member
**
Posts: 15


View Profile
« Reply #6 on: January 25, 2010, 08:01:54 AM »

I think an easier solution is to just set the column type as int, then use the getSortValue() method overload on the column that uses new Date(thedate).getTime() to get the ticks since the zero date. Now the dates will be sorted appropriately without anything fancy.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!