I am using the example from the Splunk Dashboard Examples for Table Cell Highlighting, I'm using Splunk 7.0.2. I am creating a chart where only one of the column names is known ahead of time, "testcase". I need to color cells for every cell except those in the testcase column. Per the example, it looks as though the canRender function returns true for any cell which requires rendering, i.e. for any cell which may need color added. I have tried coding the canRender function to return true if cell.field for any field other than the testcase field, but in all my attempts, the render function is still invoked for every cell, including the testcase field. Here are two examples of what I have tried:
canRender: function(cell) {
console.log("canRender: cell.field=" + cell.field);
// Enable this custom cell renderer for any field except the test case field
var testpattern = new RegExp ('test', 'i');
return _(!testpattern.test(cell.field));
},
I have also tried:
canRender: function(cell) {
console.log("canRender: cell.field=" + cell.field);
// Enable this custom cell renderer for any field except the test case field
return _(!(['testcase']).contains(cell.field));
},
I have worked around this by putting code in the render function to add the cell.value as a string for the testcase field, but if I understand how this is supposed to work, then I should not have to do that.
↧