"Jose Leon" <[EMAIL PROTECTED]> writes:

> Hello,
>   I have been digging on the mailing list and documentation and it
> seems there is not a single way, or maybe a simple way to get this
> things done for a Table object:
>
> -Set a column color (all cells that belong to an specific color)
> -Set column header color and font
> -Set column header alignment
> -Set column data alignment
> -Set the editing control for all cells in a column
>
> It would be great to get that howto's listed here:
>
> http://qooxdoo.org/documentation/snippets
>
> Is possible to do all that with the Table widget?

Jose,

To do these adjustments on a per-table, per-column basis, you'll want to
create your classes to act as header cell renderers and data cell renderers.

For doing whatever you want in a header cell, extend either
qx.ui.table.HeaderCellRenderer or qx.ui.table.DefaultHeaderCellRenderer.  The
former is the abstract class for any header cell renderer, and the latter
extends the abstract class and is the header cell renderer used by default.
Header cell renderers are quite simple, and you should find these easy to
extend.  You'll note that the DefaultHeaderCellRenderer uses setAppearance()
on the header cell widget (an Atom).  In the 0.6.x versions there is no way to
override an appearance on a per-widget basis.  If you're using 0.6.x, you'll
likely want to extend HeaderCellRenderer and emulate what's done in
DefaultHeaderCellRenderer but avoid using appearances.  If you're using 0.7,
my understanding is that widgets which have an assigned appearance can have
specific appearance attributes overridden (e.g. setColor()) so you could
easily extend DefaultHeaderCellRenderer and just override the
updateHeaderCell() method.

Similarly for data cells, you'll want to write your own data cell renderer.
Look at AbstractDataCellRenderer to see what the class needs to implement, and
then, as a simple example of a cell renderer, look at IconDataCellRenderer.
The default data cell renderer (if you don't specify one to use instead) is
DefaultDataCellRenderer so you may ultimately want to extend that one and
override the relevant methods.

Cheers,

Derrell

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to