On Wed, May 19, 2010 at 17:28, SimplyNotes <[email protected]> wrote:
> > Hi all, > I'm extending treevirtual to be able to show calculated values for branches > like count of leafs, avg, total min or max value in additional columns > (those of you knowing Lotus Notes - I mimic the categorized views in Lotus > Notes). There is an easy way to set the style for the branch label with > nodeSetCellStyle. But how can you do this for the entire branch row? > I found createRowStyle and IRowRenderer but I do not get the idea on how to > implement it for a treevirtual as the rownumber will change whenever the > user expands or collapse the tree. > An idea and code snippet would be much appreciated > Raimund, you're on the right track. The createRowStyle() method of the row renderer is called to style the row, and it is passed a parameter called rowInfo which is an object containing the information you need. Specifically, it contains the following members: table -- the table (treevirtual, in your case) object in which this row is a part row -- the row number being rendered selected -- a boolean indicating whether this row is currently selected focusedRow -- a boolean indicating whether this row is currently focused rowData -- the row data from the data model, for this row. The other possibly relevant methods are getRowClass() which is passed a parameter rowInfo with the same data as just described, and updateDataRowElement(), which is passed both a rowInfo object and the dom element (div) for a row. For your purposes, you can extend qx.ui.table.rowrenderer.Default and override these three methods, using data in the rowInfo object to determine how to render the row. If your subclass is called custom.RowRenderer then you'd specify that it should be used by calling treevirtual.setRowRenderer(new custom.RowRenderer(treevirtual)); Hope that helps get you started. Derrell
------------------------------------------------------------------------------
_______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
