I tried to inspect the javascript export button provided by Splunk and found the code that creates the ExportResultDialog in path /opt/splunk/share/splunk/search_mrsparkle/exposed/js/views/dashboard/element/Footer.js
this object is responsible for showing the export Modal and initializing the object.
I created this javascript code but it seems it has a lot of dependencies and js errors
require([
'splunkjs/mvc',
'views/shared/jobstatus/buttons/ExportResultsDialog'
], function(mvc , ExportResultsDialog) {
var btn = $('.toto')
_export = function () {
console.log(this)
/* var sid = this.manager.getSid();
console.log(sid)
*/
//this.searchJobModel.set("id", sid);
var exportDialog = new ExportResultsDialog({
model: {
//searchJob: this.searchJobModel,
//application: this.model.application,
//report: this.model.report
},
usePanelType: true,
onHiddenRemove: true
});
exportDialog.render().appendTo($("body"));
exportDialog.show();
}
btn.click( function () {_export()})
});
... View more