cancel
Showing results for 
Search instead for 
Did you mean: 

Pivot Table Formatting to Highlight Entire Rows

Yeg2023
7 - Data Storage
7 - Data Storage

Hi, 

I am trying to create a Pivot table widget, where certain rows are highlighted containing words "Conditional" and "Pending". 

These two data points are under a column named as "Status". 

 

So far, I have come up with this but it seems to not work: 

widget.on('ready', function() {
// Define the column index of the "Status" column
var StatusIndex = pivot.getColumnIndexById('Status');

// Loop through the table rows and highlight the rows containing "Conditional" or "Pending"
var rowEls = pivot.tableElement.find('tr');
rowEls.each(function() {
var rowEl = $(this);
var StatusCell = rowEl.find('td:eq(' + StatusIndex + ')');
var StatusValue = StatusCell.text().trim();
if (StatusValue === 'Conditional' || StatusValue === 'Pending') {
rowEl.css('background-color', 'yellow');
}
});
});

 

Can someone point me in the right direction. 

 

1 REPLY 1

jcordell
Community Team Member
Community Team Member

Hello! I reached out here at Sisense, and was shared this article that should be of help, you will just need to tweak it to your use case. Hope this helps! 

Jacqueline Pacheco