Hello all,
I have below javascript code that I use to change the color of my table cell:
require([
'underscore',
'jquery',
'splunkjs/mvc',
'splunkjs/mvc/tableview',
'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {
var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
canRender: function(cell) {
return _(['Performance']).contains(cell.field);
},
render: function($td, cell) {
var label = cell.value.split("|")[0];
var val = cell.value.split("|")[1];
if(val=="high")
{
$td.html("
"+label+"
")
}
else if(val=="low")
{
$td.html(""+label+"
")
}
else if(val=="no")
{
$td.html(""+label+"
")
}
else
{
$td.html(""+label+"
")
}
}
});
//List of table IDs to add icon
var tableIDs = ["customTable"];
for (i=0;i