Hi Thron,
thanks a lot for your help.
I am new to Qooxdoo, so I am not sure what you mean with
<<
Are you
feeding string data into this column of the model? If so, it would
probably be better you changed that and stored JS *Date* objects.
>>

I try to give a little bit more information.
The QX code for creating the table is:
-----------------------------------
      var tableModel = new qx.ui.table.model.Simple();
      tableModel.setColumns([ "State", "FileName", "FileSize", "Date" ]);

          var table = new qx.ui.table.Table(tableModel);
      table.setLayoutProperties({top: 120});
      table.setLayoutProperties({left: 200});
      table.setWidth(500);
      table.setHeight(200);
      
      with (table) {
           
getSelectionModel().setSelectionMode(qx.ui.table.selection.Model.SINGLE_SELECTION);
            
            setColumnWidth(0, 50);
            setColumnWidth(1, 200);
            setColumnWidth(2, 80);
            setColumnWidth(3, 150);
      };        
          win.add(table);

------------------------------------
The request to get data:
        
var req = new qx.io.remote.Request(
             "http://localhost/status/data.php";, 
              "GET", 
              "application/json");
              req.addListener("completed", function(e) {
                  try
                  {
                     var content = e.getContent();
                     if (content.length > 0) {
                                tableModel.setData(content);
                     }//if
                  }
                  catch (e)
                  {
                          alert("Fehler bei Erhalt der Tabellendaten: " +
e.toString());
                  }   
              });
                          req.setParameter("UserID", MyParam);
              req.send();

in "data.php" 
I select the FileDate from MysQL DB and format it with MySQL function
DATE_FORMAT

Select ... 
DATE_FORMAT(B.FileDate, '%d.%m.%Y %k:%i:%s') AS FileDate
from table ..
..
$recordset[] = array($color,$row['FileName'],$file_kb,$row['FileDate']  );
..
echo json_encode($recordset);

Do you mean I have to "translate" the "FileDate" at data.php into a JS Date
format?

best regards
Hansjoerg


thron7-2 wrote:
> 
> Hansjoerg,
> 
>> In a table in the column "Date" you can see a file create date. The date
>> and
>> all other info comes from a MySQL DB. The SQL request is sorted with the
>> newest date at top.
>> Example:
>> FileName, FileSize, Date
>> ---------------------------------------------
>> file1,       10kb,     01.03.2010 10:49:22
>> file2,     120kb,     26.02.2010 12:15:30
>> file3,       79kb,    30.11.2009 15:23:45
>> 
>> The problem is. If you click on the Column header "Date" the QX sort
>> mechanism does not work correct.
>> How can you handle this German date format with Qooxdoo?
> 
> There is not a single answer to this.
> 
> Firstly, it all depends what data your "Date" column actually consists
> of in the table *model* (as sorting is done on the model). Are you
> feeding string data into this column of the model? If so, it would
> probably be better you changed that and stored JS *Date* objects. You
> would have to create those Date objects from the MySQL data before
> storing the objects in the model.
> 
> If you have Date objects in your model everything should be fine, as
> Date objects are natively sortable, independently of the display format.
> So the sorting issue would be settled. As for the display, I'm sure the
> default table cell renderer for Dates honors the active locale. That is,
> if the current locale is German than the cell renderer will use a German
> date format.
> 
> If for some reason this is not possible and you need to stick with
> string values in the "Date" column, you have two options: You either
> enter the strings in a format that is lexically sortable (e.g.
> "2009.11.30 15:23:45"). Or, as the last resort, you will have to provide
> a custom sort function, e.g. using
> qx.ui.table.model.Simple#setSortMethods() if you are using the Simple
> model for your table. In your custom sort methods you would then have to
> parse the strings and apply proper comparisons to achieve the desired
> ordering. But I really wouldn't recommend this approach, as it is
> probably very slow and not very flexible.
> 
> T.
> 
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Table-sort-order-for-German-date--tp27742128p27744492.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to