Hello guys !
I'm trying to create a custom row expansion, which seemed to be simple task and became a big headache.
Before i even will try to add a meaningful data, i am just trying to add generic data to the rows.
This is my JS :
require([
'splunkjs/mvc/tableview',
'splunkjs/mvc/chartview',
'splunkjs/mvc/searchmanager',
'splunkjs/mvc',
'underscore',
'splunkjs/mvc/simplexml/ready!'],function(
TableView,
ChartView,
SearchManager,
mvc,
_
){
// Create a search manager
var mysearch = new SearchManager({
id: "main-search",
preview: false,
cache: false,
search: "| makeresults | eval check=3 | fields - _time"
});
// Create a table
var myTableView = new TableView({
id: "mytable",
managerid: "main-search",
drilldown: "none",
el: $("#mytable")
});
//create row renderer
var EventSearchBasedRowExpansionRenderer = TableView.BaseRowExpansionRenderer.extend({
canRender: function(rowData) {
console.log("RowData: ", rowData);
return true;
},
render: function($container, rowData) {
// Print the rowData object to the console
console.log("RowData: ", rowData);
$container.append(mysearch);
}
});
// Create an instance of the basic row renderer
var tableRowRender = new EventSearchBasedRowExpansionRenderer();
// Add the row renderer to the table
myTableView.addRowExpansionRenderer(tableRowRender);
// Render the table
myTableView.render();
});
});
In addition i added to the source of the dashboard the script="custom_table_row_expansion.js" and the table id="myTableView".
Can anyone help me with that ?
Thanks.
... View more