Splunk Dev

Splunk Modal window with tableview rendered

spammenot66
Contributor

I'm trying to get my dashboard to show a modal window with a tableview containing search assigned to the tableview.  The tableview search is not to show search with updated token value. 

 

 

 

<row>
    <panel>
      <title>$show_ModalTable$</title>
      <chart>
        <search>
          <query>index=_internal sourcetype="splunkd" log_level IN ("ERROR", "WARN")|stats count by component</query>
          <earliest>-60m@m</earliest>
          <latest>now</latest>
        </search>
        <option name="refresh.display">progressbar</option>
        <drilldown>
          <set token="show_ModalTable">$row.component$</set>
        </drilldown>
      </chart>
    </panel>
    <panel>
      <html>
        <div class="modal hide fade" id="modaltable_div">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true"/>
            <h3>Modal header</h3>
        </div>
        <div id="modaltable_detail"/>
        <!--<div class="modal-footer">
            <a href="#" class="btn">Close</a>
            <a href="#" class="btn btn-primary">Save changes</a>
        </div>-->
        </div>
      </html>
    </panel>
  </row>
require([
    'underscore',
    'jquery',
    'splunkjs/mvc',
    'splunkjs/mvc/searchmanager',
    'splunkjs/mvc/searchcontrolsview',
    'splunkjs/mvc/tableview',
    'splunkjs/mvc/chartview',
    'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, SavedSearchManager, SearchControlsView, TableView, ChartView) {
	
	// Listen for token changesvar 
	tokens = mvc.Components.get("default");
    var tv= new TableView({
        id: 'modal_table',
        data: "results" ,
        managerid: 'modaltable_search',
        el: $('#modaltable_detail')
    }).render();

	tokens.on("change:show_ModalTable", function(model, value, options) {
		$('#modaltable_div').modal();
		//mvc.Components.revokeInstance("modal_table");
		var sm = mvc.Components.getInstance("modaltable_search");
        
        sm.startSearch();
        console.log(sm.settings.get("search"))
        
	});
});

 

 

 

 

 

 

 

Labels (3)
Tags (2)
0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...