0 votes
1.0k views
in Coach Views by (30.6k points)

1 Answer

0 votes
by (30.6k points)

Row highlighting in the UI Toolkit Table is done in the table's row rendering event, which receives the record; you decide the class or style per row:

// Table "Orders" > Events > On row rendered   (row = <tr> element, record = the bound list element, index)
row.classList.remove("danger", "warning", "success");
if (record.status === "REJECTED")      row.classList.add("danger");     // Bootstrap 3 row classes: active, success, info, warning, danger
else if (record.amount > 10000)        row.classList.add("warning");
else if (record.status === "APPROVED") row.classList.add("success");

// arbitrary style
if (record.priority === "HIGH") { row.style.fontWeight = "bold"; row.style.borderLeft = "4px solid #d9534f"; }

Re-apply after the data changes: the table re-renders rows when the bound list changes (setData) or when you call ${Orders}.refresh(); if you change a field of one record from code, refresh that row (${Orders}.refresh(); newer toolkits also offer a per-row refresh).

Older toolkit versions without On row rendered: use the Render cell option of one column to climb to the row (cell.parentNode.classList.add(...)), or a formula-driven hidden column plus CSS. For the heritage Dojo table the only hook was CSS per row parity - upgrade to the UI Toolkit table. Related: question 3130 (colours per column).

References

Related questions

+1 vote
1 answer 1.2k views
0 votes
1 answer 2.3k views
0 votes
1 answer 4.1k views
0 votes
1 answer 1.4k views
0 votes
1 answer 1.7k views
0 votes
1 answer 2.5k views
0 votes
4 answers 4.5k views
0 votes
1 answer 1.6k views
0 votes
1 answer 1.2k views
+1 vote
1 answer 2.5k views
0 votes
1 answer 1.1k views
0 votes
1 answer 874 views

723 questions

807 answers

98 comments

4.9k users

Join BPM Community Discord Channel

Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
Created by Dosvak LLC
Our Youtube Channel
...