I verified this and it works after
restart and clearing your browsercache:
cat blabla/appserver/static/table_icons_inline2.js ::
require([
'underscore',
'jquery',
'splunkjs/mvc',
'splunkjs/mvc/tableview',
'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {
var CustomIconRenderer = TableView.BaseCellRenderer.extend({
canRender: function(cell) {
return cell.field === 'count';
},
render: function($td, cell) {
var count = cell.value;
// Compute the icon base on the field value
var icon;
if(count > 3000) {
icon = 'alert-circle';
} else if(count > 1000) {
icon = 'alert';
} else {
icon = 'check';
}
// Create the icon element and add it to the table cell
$td.addClass('icon-inline numeric').html(_.template('<%- text %> <i class="icon-<%-icon%>"></i>', {
icon: icon,
text: cell.value
}));
}
});
mvc.Components.get('table1').getVisualization(function(tableView){
// Register custom cell renderer
tableView.table.addCellRenderer(new CustomIconRenderer());
// Force the table to re-render
tableView.table.render();
});
mvc.Components.get('table2').getVisualization(function(tableView){
// Register custom cell renderer
tableView.table.addCellRenderer(new CustomIconRenderer());
// Force the table to re-render
tableView.table.render();
});
});
—————————
cat blabla/default/data/ui/views/custom_table_icon_set_inline2.xml:
<label>Table Icon Set (Inline)</label>
<row>
<table id="table1">
<title>Render Icons based on rangemap result</title>
<searchString>index=_internal | stats count by sourcetype,source,host</searchString>
<earliestTime>-1h</earliestTime>
<option name="drilldown">none</option>
</table>
</row>
<row>
<table id="table2">
<title>Render second table Icons based on rangemap result</title>
<searchString>index=_internal | stats count by component</searchString>
<earliestTime>-1h</earliestTime>
<option name="drilldown">none</option>
</table>
</row>
... View more