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

Reply via email to