0 votes
882 views
in Coach Views by

1 Answer

0 votes
by (30.6k points)

Colours per row or column in the UI Toolkit table are set in its rendering events - the same technique as in questions 3130, 763 and 138:

// rows: Table > Events > On row rendered  (row, record, index)
if (record.status === "OVERDUE") row.style.backgroundColor = "#f2dede";
if (index % 2 === 1) row.classList.add("striped-alt");                // zebra striping when the table style is off

// columns / cells: Column > Render cell  (cell, record, column)
cell.style.color = record.amount < 0 ? "#a94442" : "#3c763d";
if (column.label === "Amount") cell.style.textAlign = "right";

Whole columns without code: give the table a Custom CSS class and style the nth column: .myTable td:nth-child(3), .myTable th:nth-child(3) { background: #fcf8e3; } in a managed CSS asset. Refresh after data changes (${Table}.refresh()) so that the renderers run again. The old Dojo table (Coaches toolkit) only offered per-column style expressions; upgrade to the UI Toolkit table for anything data-driven.

References

Related questions

0 votes
1 answer 1.5k views
0 votes
1 answer 1.1k views
+1 vote
1 answer 1.2k views
0 votes
1 answer 863 views
0 votes
1 answer 4.0k views
0 votes
1 answer 1.7k views
0 votes
1 answer 938 views
0 votes
1 answer 4.1k views
0 votes
1 answer 2.0k views
0 votes
1 answer 1.7k views
0 votes
1 answer 736 views
0 votes
1 answer 729 views

730 questions

807 answers

98 comments

5.0k 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
...