The problem was I the string I used to display the count variable wasn't properly concatenated. When I tried to alert the value of count , the improper concatenation caused it to appear null when in fact it was storing a value all along. If I had pasted the complete segment of code, that would have been apparent. Comparing the time value never popped up as an issue, All that needed to be done was to compare the variable to a time-formatted string like "00:30:00" (when comparing against 30 minutes).
Here's my customized CustomIconRenderer from table_icons_inline.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 === 'Delta Since Current Upload';
},
render: function($td, cell) {
var count = cell.value;
// Compute the icon base on the field value
var icon;
//alert("Count concatenated by + to this string is " + count);
if(count > "00:30:00") {
icon = 'alert-circle';
} else if(count > "00:20:00") {
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
}));
}
});
... View more