Hi Tobias,

within qooxdoo0.6.6, I helped myself by overriding qx.Proto.sortByColumn
in a custom sorting table model which is derived from 
qx.ui.table.SimpleTableModel, like that:

------------
qx.Proto.sortByColumn = function(columnIndex, ascending) {
   // NOTE: We use different comperators for ascending and descending,
   //     because comperators should be really fast.
   var comparator;
   if (ascending) {
     comparator = function(row1, row2) {
       var obj1 = (isNaN(row1[columnIndex]) ? 
row1[columnIndex].toLowerCase() : row1[columnIndex]);   // overridden
       var obj2 = (isNaN(row2[columnIndex]) ? 
row2[columnIndex].toLowerCase() : row2[columnIndex]);
       return (obj1 > obj2) ? 1 : ((obj1 == obj2) ? 0 : -1);
     }
   } else {
     comparator = function(row1, row2) {
       var obj1 = (isNaN(row1[columnIndex]) ? 
row1[columnIndex].toLowerCase() : row1[columnIndex]);
       var obj2 = (isNaN(row2[columnIndex]) ? 
row2[columnIndex].toLowerCase() : row2[columnIndex]);
       return (obj1 < obj2) ? 1 : ((obj1 == obj2) ? 0 : -1);
     }
   }

   this._rowArr.sort(comparator);

   this._sortColumnIndex = columnIndex;
   this._sortAscending = ascending;

 
this.createDispatchEvent(qx.ui.table.TableModel.EVENT_TYPE_META_DATA_CHANGED);
}

HTH

Bye
Stefan


Tobias Koller (GERMO GmbH) schrieb:
> hi hist,
> 
>  
> 
> how can I sort the table if there are uppercase and lowercase strings in 
> on column?
> 
>  
> 
> f.e: I have the following entries in column 1:
> 
>  
> 
> A
> 
> a
> 
> B
> 
> b
> 
> C
> 
> c
> 
>  
> 
> if I sort them asc then it looks like:
> 
>  
> 
> A
> 
> B
> 
> C
> 
> a
> 
> b
> 
> c
> 
>  
> 
>  
> 
> did I make something wrong?
> 
>  
> 
> Thanks
> 
> Tobias
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to