I am trying to make some Pivot Tables in Dashboard with Table widget.
there is a default options to toggle on row striping and it alternates the color of the rows:
However, if you choose Advanced Formatting for the values, the arcade overrides all the row striping, and I can't find any example/method to turn that back on with arcade.
Is this possible? Any samples out there similar to this?
Thanks,
R_
Solved! Go to Solution.
Hi there,
I don't know if you finally figured this out but in case someone needs it you can use a simple logic before the return statement to check $rowindex value using module operator:
var color = ''
if ($rowindex %2 == 0) {
color = '#3ff6f6'
}
else {
color = '#ffffff'
}
And then you just set color variable to background property. You can see the result in the attachment png.
Hope this helps anyone out there.
Regards.
Hi there,
I don't know if you finally figured this out but in case someone needs it you can use a simple logic before the return statement to check $rowindex value using module operator:
var color = ''
if ($rowindex %2 == 0) {
color = '#3ff6f6'
}
else {
color = '#ffffff'
}
And then you just set color variable to background property. You can see the result in the attachment png.
Hope this helps anyone out there.
Regards.
Hi @Kepa ,
This is my code for row striping and it works but now I noticed that I can't do individual background cell color. Is there a way within the for loop to do individual cell color and row color?
var bgColor = When($rowindex %2 == 0, '#ffffff', '#F8F8F8');
for (var cell in row.cells) {
row.cells[cell].backgroundColor = bgColor;
}
't
Thank you @Kepa , but yes, I did figure this out.
However, came up with the same solution, so will mark your post as the answer.
R_