"Jim Hunter" <[EMAIL PROTECTED]> writes:

> OK, that explanation does help clear things up a bit. Later I will dig
> deeper into the code to see how I can exploit it. Thanks for the
> explanation.
>
> Jim
>
> On 7/26/06, Til Schneider <[EMAIL PROTECTED]> wrote:
>>
>> > So what you are saying is that there is no way to set the entire row
>> > color, I have to set each cells color one at a time? I would think that
>> > there needs to be a built in way to easily set the entire rows font and
>> > color and style and not have to do it on a cell by cell basis.
>>
>> It's up to your renderer how the cells should like. You could create a
>> cell renderer that sets the background of all cells to one color. The
>> default cell renderer for example does an alternating row coloring
>> depending on the row index.
>>
>> Perhaps it's a general misunderstanding. The table cells are virtual.
>> There is no widget for each cell were you could set the background color
>> like in other qooxdoo widgets. The table is designed for huge data
>> models. This wouldn't be possible if each cell had a widget
>> representation. There are only renderers which are able to create the
>> HTML that shows a cell.

Jim, you might try this (untested) patch, and provide your own function for
rowRenderCallback.  I'd be interested to know how this works.

Note that this currently is only implemented for when USE_ARRAY_JOIN==false.
It can't be done in the same way for when USE_ARRAY_JOIN==true, so this is not
an appropriate patch for long-term.  There should be some common way of doing
it so that both work, though.

Derrell

=== source/script/qx/ui/table/TablePane.js
==================================================================
--- source/script/qx/ui/table/TablePane.js      (revision 17114)
+++ source/script/qx/ui/table/TablePane.js      (local)
@@ -446,6 +446,9 @@
     }
     rowElem.style.color = cellInfo.selected ? TablePane.CONTENT_COL_SELECTED : 
TablePane.CONTENT_COL;
 
+    // Allow for custom row rendering
+    qx.ui.table.TablePane.rowRenderCallback(rowElem, cellInfo);
+
     if (!recyleRowElem || !onlySelectionOrFocusChanged) {
       var html = "";
       var left = 0;
@@ -533,6 +536,21 @@
   return qx.ui.basic.Terminator.prototype.dispose.call(this);
 }
 
+/**
+ * Function called during rendering, to customize a particular row's
+ * appearance.
+ *
+ * By default, no custom styles are applied.  Users of this class may provide
+ * a different function which optionally alters the appearance of the row.
+ *
+ * @param rowElem
+ *   The row element being created.  It can be manipulated by applying styles,
+ *   e.g. rowElem.style.backgroundcolor = 'red';
+ *
+ * @param cellInfo
+ *   See [EMAIL PROTECTED] #createDataCellHtml}.
+ */
+qx.Class.rowRenderCallback = function() { };
 
 qx.Class.USE_ARRAY_JOIN = false;
 qx.Class.USE_TABLE = false;

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to