Hi,
I've been displaying a table, but now we have a request to highlight certain
rows in the table. I have a RowRenderer to handle the rendering, does
highlights when row selected, etc. but wondering the best way to pass the
"is a header" attribute for a particular row to be highlighted. So,
something like:

data = ["header 1", "row b", "row c", "this is a hdr, too", "row e", "row
f"];   // this is really an array of arrays, not just strings!
dataModel.setData(data);

In my rowRenderer, I have a createRowStyle : function(rowInfo) which sets
the colors for the row, etc. but the rowInfo param doesn't have much in the
way of attributes - it has the row number (I could use this, I suppose, to
remember that row 0 and row 3 are headers), but there's not much else to go
on. Is there a way to attach a user attribute to rowInfo?

What I did for the meantime is to add an additional invisible column to my
data array (my table has only 1 visible column):

Instead of
data.append(["Im a header"]);

I did:
data.append(["Im a header", true]);

and tested for the value of the invisible column in the RowRenderer to see
if it should be treated as a header:

if (rowInfo.rowData[1]) // render as header - different colors, etc.

Works slick, but I'm just wondering if there's a more standard way to handle
this.
Ken
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to