Hi,
I would like to render my table cells in different colors (background),
but don't know how to bring it to work.
I think the CellRenderer will be the right choise. Formatting the text -
color isn't a problem, but I don't know how to use the 'style' -
parameter. Where can I find an overview of all attributes the 'style' -
attribute can handle with? Or isn't the 'style' - parameter the right
solution anyway?
Of course there are many examples in the demo - browser, but I can't
find something about style or background - color?!?
Here's some example - code I'm dealing with, but it does not work either...
Example 1:
----------
...
// my Table
var table = new qx.ui.table.Table( this.createTableModel() );
// my Style
var cellStyle =
{
value : ["xxx"],
styleLeft : [0],
styleWidth : [100],
styleHeight : [20],
style: [""]
}
// my Renderer
var renderer = new qx.ui.table.cellrenderer.String( "center", "",
cellStyle, "" );
// adding a condition
// (without an 'dummy' - condition, no formatting is shown at all?!?)
renderer.addNumericCondition( ">", 0, null, "#FF0000", null, null, 1 );
// Dummy... ?!?
// set the Renderer
table.getTableColumnModel().setDataCellRenderer( 0, renderer );
...
Example 2:
----------
...
// my Table
var table = new qx.ui.table.Table( this.createTableModel() );
// my Style
var cellStyle =
{
value : ["xxx"],
styleLeft : [0],
styleWidth : [100],
styleHeight : [20],
style: [""]
}
// my Renderer
var renderer = new qx.ui.table.cellrenderer.String();
// adding a condition
// (without an 'dummy' - condition, no formatting is shown at all?!?)
renderer.addNumericCondition( ">", 0, null, "#FF0000", null, null, 1 );
// Dummy... ?!?
var html = ["<div
style='position:absolute;height:20px;width:100px;top:10px'>"];
renderer.createDataCellHtml( cellStyle, html );
html.push("</div>");
// set the Renderer
table.getTableColumnModel().setDataCellRenderer( 0, renderer );
...
I'm quite new to web technologies, so in fact there are some basics I
didn't understand right now, so please be patient... ;)
Thanks in advance!
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel