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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...