Hi,
On 03/16/2010 12:03 PM, [email protected] wrote:
> Hello Thron
> you gave me some tips regarding my post in Qooxdoo mailing list.
> It was at 01. March, and I have tested it now.
> sorry for the delay.
> I am not sure if I can reply for such an old post.
That is no problem. It's actually better you post on the list, as more
people are watching it and your post is less likely to be overlooked :).
> So;
> your tipp will work nearly as I expected
>
> My Date comming from the MySQL db is;
> 02.03.2010 12:06:45
> If I use your code below the Table column "Date" shows now only the Date
> without the time.
> But I can it sort now.
>
> Any idea why there is no time in the column?
Look, you have to distinguish data from presentation (this is sort of
the "MVC" mantra). In your code, you are adding Date objects to your
table model, i.e. the data of the table. These objects are binary data,
as other table data might be (like floats, images, etc.). The model is
only concerned with managing this data, and is *not* concerned how it is
displayed to the user.
The *displaying* of data is taken care of by other parts of the table,
most prominently the so called "cell renderers". They are in charge of
presenting the table data to the user. The default cell renderers that
come with the table take care of the most commonly used data types in a
table, the one taking care of Date objects is
qx.ui.table.cellrenderer.Date. You can influence how this cell renderer
works, just check out the API docs.
The basic approach for your problem now is that you create a new Date
cell renderer instance, customize it (e.g. call .setDateFormat), and
then set it to your table's column model (huh, so many models...). You
get at the column model - you guessed it - with
table.getTableColumnModel() . At the column model, you set your
customized Date cell renderer with .setDataCellRenderer().
HTH,
T.
>
> best regards
> Hansjoerg
>
> var content = e.getContent();
> var row;
> var dateFormat = new
> qx.util.format.DateFormat("dd.MM.yyyy HH:mm:ss");
> for (var i=0; i<content.length;
> i++) {
> row = [];
> row[0] = content[i][0];
> row[1] = content[i][1];
> row[2] = content[i][2];
> row[3] =
> dateFormat.parse(content[i][3]);
>
> tableModel.addRows([row]);
> }
>
>
>
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel