Hi Jonathan,
I don't know if this will help you, but I'll like to help you more.
If I have understood well, you need the right javascript codes of inline icons under dashboard examples, in the simple_xml_examples you can choose Table Icon Set (Inline) for the good application that you need. Below is the right code for .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();
});
});
You can found this table_icons_inline.js in the link below in your local machine if you have intalled simple_xml_examples app:
$Splunk_home$\etc\apps\simple_xml_examples\appserver\static then follow the below link in splunk web for simple xml code:
/en-US/app/simple_xml_examples/custom_table_icon_set_inline?earliest=0&latest=
Please let me know if you have more suggestion. Thanks and regards
... View more