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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...