0 votes
2.8k views
in Client-Side Human Services by (120 points)
by (220 points)
If you have that table inside a CV, write css classes and Add that class for only those columns

1 Answer

0 votes
ago by (30.6k points)

The UI Toolkit Table control lets you style rows and cells from JavaScript; the hook is the Render Cell / Render Row (row-level "onRowRendered") events and the record data.

Rows by data - use the table's On row rendered (or the Table's Row style formula on newer toolkits) event:

// Table control > Events > On row rendered:  (row, record, index)
if (record.status === "OVERDUE") row.style.backgroundColor = "#f8d7da";        // light red
if (record.amount > 10000)      row.classList.add("warning");                  // Bootstrap class

Cells / columns - the column definition has a Render cell option (or use "On cell rendered" of the table):

// Column "Amount" > Render cell:  (cell, record, column)
cell.style.color = record.amount < 0 ? "red" : "green";
cell.style.fontWeight = "bold";

Whole columns can also be coloured with plain CSS on the column class the toolkit generates (.tableCol-2 on older toolkits, [data-col="Amount"] on newer ones); put the CSS in a managed asset included by the coach view.

Selected rows already get the Bootstrap "info" class; to highlight rows programmatically use ${Table}.highlightRow(index) if available, otherwise re-render with ${Table}.refresh() after changing a flag field that the row renderer looks at (for example record.__highlight).

Older heritage "Table" (Dojo) control: the only hook is the Row style expression per column, or CSS by row parity; that control is deprecated - the UI Toolkit table is the way to go.

References

Related questions

0 votes
1 answer 865 views
0 votes
1 answer 1.4k views
0 votes
1 answer 1.1k views
0 votes
1 answer 842 views
+1 vote
1 answer 1.2k views
0 votes
1 answer 4.0k views
0 votes
1 answer 1.3k views
0 votes
1 answer 1.7k views
0 votes
1 answer 1.9k views
0 votes
1 answer 921 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
...