Hello,
I have found an issue in the current framework (1.2-pre/trunk):
When you set the 'caseSensitiveSorting' property of the table-model to 'false',
the sorting does not work when the model-data contains <null> values.
See http://tinyurl.com/23xd9tg for a demonstration
Attached you will find a patch for
"./framework/source/class/qx/ui/table/model/Simple.js"
that fixes this issue for me.
(This is what it changes: Whether to use "toLowerCase()"-method or not, depends
on the result of "qx.lang.Type.isString(...)" now, that's all.)
Do you like me to file a bug for this, or can the issue be fixed by someone
of the framework-team without filing one?
Best Regards,
Peter
Index: Simple.js
===================================================================
--- Simple.js (Revision 22240)
+++ Simple.js (Arbeitskopie)
@@ -84,9 +84,9 @@
*/
_defaultSortComparatorInsensitiveAscending : function(row1, row2)
{
- var obj1 = (row1[arguments.callee.columnIndex].toLowerCase ?
+ var obj1 = (qx.lang.Type.isString(row1[arguments.callee.columnIndex]) ?
row1[arguments.callee.columnIndex].toLowerCase() :
row1[arguments.callee.columnIndex]);
- var obj2 = (row2[arguments.callee.columnIndex].toLowerCase ?
+ var obj2 = (qx.lang.Type.isString(row2[arguments.callee.columnIndex]) ?
row2[arguments.callee.columnIndex].toLowerCase() :
row2[arguments.callee.columnIndex]);
if (qx.lang.Type.isNumber(obj1) && qx.lang.Type.isNumber(obj2)) {
@@ -130,9 +130,9 @@
*/
_defaultSortComparatorInsensitiveDescending : function(row1, row2)
{
- var obj1 = (row1[arguments.callee.columnIndex].toLowerCase ?
+ var obj1 = (qx.lang.Type.isString(row1[arguments.callee.columnIndex]) ?
row1[arguments.callee.columnIndex].toLowerCase() :
row1[arguments.callee.columnIndex]);
- var obj2 = (row2[arguments.callee.columnIndex].toLowerCase ?
+ var obj2 = (qx.lang.Type.isString(row2[arguments.callee.columnIndex]) ?
row2[arguments.callee.columnIndex].toLowerCase() :
row2[arguments.callee.columnIndex]);
if (qx.lang.Type.isNumber(obj1) && qx.lang.Type.isNumber(obj2)) {
var result = isNaN(obj1) ? isNaN(obj2) ? 0 : 1 : isNaN(obj2) ? -1 :
null;
------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel