I think I have it! :-)
Here is my code (if someone is interested)
--------------------------
var row;
var dateFormat = new qx.util.format.DateFormat("dd.MM.yyyy HH:mm:ss");
var tcm1 = table.getTableColumnModel();
// set column 3 to date format
var cellrenderer = new qx.ui.table.cellrenderer.Date();
cellrenderer.setDateFormat(new qx.util.format.DateFormat("dd.MM.yyyy
HH:mm:ss"));
tcm1.setDataCellRenderer(3, cellrenderer);
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]);
}
-------------------------
Thomas thanks a lot for your help and for your patient.
I have learned a lot :-)
best regards
Hansjoerg
thron7-2 wrote:
>
>
>
> On 03/16/2010 04:51 PM, Qoodary wrote:
>>
>> Now I have read the Api for the cellrenderer.Date and take a look to the
>> demobrowser basic table demo
>>
>> I tried following:
>>
>> var tcm = table.getTableColumnModel();
>> // set column 3 to date format
>> var datecell = tcm.setDataCellRenderer(3, new
>> qx.ui.table.cellrenderer.Date());
>> datecell.setDateFormat(new qx.util.format.DateFormat("dd.MM.yyyy
>> HH:mm:ss"));
>>
>> I think the part with "datecell.setDateFormat(.." is wrong
>
> Yep. If you look at the API for .setDataCellRenderer() you see that it
> is returning 'void'. So there is no use of capturing the return value,
> and trying to do something with it will fail. Your 'datecell' is just
> null or undef.
>
>>
>> I get;
>> Typerror undefined
>>
>> If I understand correct, the setDateFormat is a method of the cellrender?
>
> Correct.
>
>> How can I set this?
>
> Easy. Just disentangle the instantiation of the cell renderer and the
> modification of the column model:
>
> // create a proper cell renderer first
> var mycellrenderer = new qx.ui.table.cellrenderer.Date();
> mycellrenderer.setDateFormat(new qx.util.format.DateFormat("dd.MM.yyyy
>> HH:mm:ss"));
>
> // then set it in the column model
> tcm.setDataCellRenderer(3, mycellrenderer);
>
>
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
--
View this message in context:
http://old.nabble.com/Re%3A-Date-Format-tp27918064p27920889.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.
------------------------------------------------------------------------------
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