Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>you have to subclass the qooxdoo default row renderer to make that happen. Take a look at the following code which you can test in the qooxdoo playground. It shows you how to do it.</p> <pre><code> function createRandomRows(rowCount) { var rowData = []; var now = new Date().getTime(); var nextId = 0; for (var row = 0; row &lt; rowCount; row++) { rowData.push([ nextId++, Math.random() * 10000]); } return rowData; } // window var win = new qx.ui.window.Window("Table").set({ layout : new qx.ui.layout.Grow(), contentPadding: 0 }); this.getRoot().add(win); win.open(); // table model var tableModel = new qx.ui.table.model.Simple(); tableModel.setColumns([ "ID", "A number" ]); tableModel.setData(createRandomRows(10000)); // table var table = new qx.ui.table.Table(tableModel).set({decorator: null}) /** * New row renderer! */ qx.Class.define("condRow", { extend : qx.ui.table.rowrenderer.Default, members : { // overridden updateDataRowElement : function(rowInfo, rowElem) { this.base(arguments, rowInfo, rowElem); var style = rowElem.style; if (!(rowInfo.focusedRow &amp;&amp; this.getHighlightFocusRow()) &amp;&amp; !rowInfo.selected) { style.backgroundColor = (rowInfo.rowData[1] &gt; 5000) ? this.__colors.bgcolEven : this.__colors.bgcolOdd; } }, // overridden createRowStyle : function(rowInfo) { var rowStyle = []; rowStyle.push(";"); rowStyle.push(this.__fontStyleString); rowStyle.push("background-color:"); if (rowInfo.focusedRow &amp;&amp; this.getHighlightFocusRow()) { rowStyle.push(rowInfo.selected ? this.__colors.bgcolFocusedSelected : this.__colors.bgcolFocused); } else { if (rowInfo.selected) { rowStyle.push(this.__colors.bgcolSelected); } else { // here is the second magic rowStyle.push((rowInfo.rowData[1] &gt; 5000) ? this.__colors.bgcolEven : this.__colors.bgcolOdd); } } rowStyle.push(';color:'); rowStyle.push(rowInfo.selected ? this.__colors.colSelected : this.__colors.colNormal); rowStyle.push(';border-bottom: 1px solid ', this.__colors.horLine); return rowStyle.join(""); }, } }); table.setDataRowRenderer(new condRow(table)); win.add(table); </code></pre> <p>At the bottom of the code you see the new row renderer which marks all rows having a bigger number than 5000 in the second column. </p> <p>​Regards, Martin</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload