Forum Discussion
harikm007
02-19-2022Data Warehouse
If you are using Pivot2, please try this script (Reference)
widget.on('ready', function(se, ev) {
panelName = 'Value 1' //Update your panel name from which color needs to spread to entire row
var colIndex = -1
$('pivot2 .pivot-scroller table tbody tr').each(function(index, trElement){
if(index == 0)
{
$(trElement).find('td .table-grid__content .table-grid__content__inner').each(function(tdIndex, tdElement){
if ($(tdElement).text() == panelName){
colIndex = tdIndex
}
})
}
else{
if(colIndex >= 0){
bgColor = $(trElement).find('.table-grid__cell--col-' + colIndex).css('backgroundColor')
$(trElement).find('td').each(function(tdIndex, tdElement){
$(tdElement).css('backgroundColor', bgColor)
})
$('pivot2 .table-grid--rows table tbody tr').each(function(rowIndex, rowElement){
if(rowIndex > 0 && index == rowIndex){
$(rowElement).find('td').css('backgroundColor', bgColor)
}
})
}
}
})
})
-Hari
cartercjb
02-21-2022ETL
Thanks, Hari.
I am using the default Pivot widget.. is that Pivot 2 or is that a blox widget? If it is a blox widget, can you please reference the default article to create a pivot 2 widget? Thanks!
-Carter
- harikm00702-21-2022Data Warehouse
Pivot2 is also displayed as normal Pivot widget. My understanding is Pivot2 is available in Sisense Linux version. Not sure if it is available for windows.
-Thanks
- cartercjb02-21-2022ETL
Thanks, Hari. harikm007
Here is the script I used based on your recommendation:
/* Welcome to your Widget's Script. To learn how you can access the Widget and Dashboard objects, see the online documentation at https://developer.sisense.com/pages/viewpage.action?pageId=557127 */ widget.on('ready', function(se, ev) { panelName = 'UNITS' //Update your panel name from which color needs to spread to entire row var colIndex = -1 $('pivot2 .pivot-scroller table tbody tr').each(function(index, trElement){ if(index == 0) { $(trElement).find('td .table-grid__content .table-grid__content__inner').each(function(tdIndex, tdElement){ if ($(tdElement).text() == panelName){ colIndex = tdIndex } }) } else{ if(colIndex >= 0){ bgColor = $(trElement).find('.table-grid__cell--col-' + colIndex).css('backgroundColor') $(trElement).find('td').each(function(tdIndex, tdElement){ $(tdElement).css('backgroundColor', bgColor) }) $('pivot2 .table-grid--rows table tbody tr').each(function(rowIndex, rowElement){ if(rowIndex > 0 && index == rowIndex){ $(rowElement).find('td').css('backgroundColor', bgColor) } }) } } }) })
Here is the output:
Am I missing something?
- harikm00702-21-2022Data Warehouse
Please check if you are using pivot2.
This is how I normally check whether it is Pivot or Pivot2:
-Hari