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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...