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® 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