I would like to know wich is the rigth method to sort a table data by a
column which contains dates.
I used, as last solution,
tbl.getTableModel().setSortMethods(0, {
ascending : this.sortAscDate,
descending : this.sortDescDate
});
where:
sortAscDate: function(row1, row2){
var obj1 = row1[arguments.callee.columnIndex];
var obj2 = row2[arguments.callee.columnIndex];
var aDate = obj1.split("-");
var v1=aDate[2]+aDate[1]+aDate[0];
v1=parseInt(v1);
var aDate = obj2.split("-");
var v2=aDate[2]+aDate[1]+aDate[0];
v2=parseInt(v2);
return (v1 > v2);
},
(each cell, coming from a json, is formatted like dd-mm-YYYY).
Another idea is adopting a hidden column containing the same dates in
microseconds, but i don't know how to do it.
I'working on this problem, tring different solutions, from two days.
pielle
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/sorting-table-by-date-tp7582236.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel