<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to enable/disable drilldown via javascript in an HTML dashboard? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245608#M15305</link>
    <description>&lt;P&gt;Then you have to use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var myview = mvc.Components.getInstance("your_view_id");
myview.settings.set('drilldown', 'none');
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What you did is to select a dom element. Ofcourse the dom element does not have a set function for drilldowns. Only the model of the view has the settings and methods that are mentioned in the reference here: &lt;A href="http://docs.splunk.com/Documentation/WebFramework"&gt;http://docs.splunk.com/Documentation/WebFramework&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Greetings&lt;/P&gt;

&lt;P&gt;Tom&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2015 11:48:01 GMT</pubDate>
    <dc:creator>tom_frotscher</dc:creator>
    <dc:date>2015-09-30T11:48:01Z</dc:date>
    <item>
      <title>How to enable/disable drilldown via javascript in an HTML dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245604#M15301</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to know how to enable and disable drilldown with jquery using onclick event.&lt;/P&gt;

&lt;P&gt;ps: i'm using an html dashboard&lt;/P&gt;

&lt;P&gt;thx&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 12:50:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245604#M15301</guid>
      <dc:creator>sfatnass</dc:creator>
      <dc:date>2015-09-29T12:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable drilldown via javascript in an HTML dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245605#M15302</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;get the component by id and use preventDefault to prevent the default onclick behavior.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   var myview = mvc.Components.getInstance("your_view_id");
   myview.on("click", function (e) {
       e.preventDefault();
       // To do: respond to events
   });
 });
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2015 13:29:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245605#M15302</guid>
      <dc:creator>tom_frotscher</dc:creator>
      <dc:date>2015-09-29T13:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable drilldown via javascript in an HTML dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245606#M15303</link>
      <description>&lt;P&gt;The question is about drilldown&lt;/P&gt;

&lt;P&gt;I know how use jquery in Splunk, but how can change drilldown settings?&lt;/P&gt;

&lt;P&gt;I tried this, but it doesn't work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;document.getElementById('id_table').settings.set('drilldown','none');

and 

document.getElementById('id_table').setattr('drilldown','none');
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Another person searched about this function: &lt;BR /&gt;
&lt;A href="http://answers.splunk.com/answers/216486/how-to-enable-disable-table-element-drilldown-thro.html"&gt;http://answers.splunk.com/answers/216486/how-to-enable-disable-table-element-drilldown-thro.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;thx&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 14:38:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245606#M15303</guid>
      <dc:creator>sfatnass</dc:creator>
      <dc:date>2015-09-29T14:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable drilldown via javascript in an HTML dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245607#M15304</link>
      <description>&lt;P&gt;nobody can help?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2015 11:41:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245607#M15304</guid>
      <dc:creator>sfatnass</dc:creator>
      <dc:date>2015-09-30T11:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable drilldown via javascript in an HTML dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245608#M15305</link>
      <description>&lt;P&gt;Then you have to use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var myview = mvc.Components.getInstance("your_view_id");
myview.settings.set('drilldown', 'none');
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What you did is to select a dom element. Ofcourse the dom element does not have a set function for drilldowns. Only the model of the view has the settings and methods that are mentioned in the reference here: &lt;A href="http://docs.splunk.com/Documentation/WebFramework"&gt;http://docs.splunk.com/Documentation/WebFramework&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Greetings&lt;/P&gt;

&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2015 11:48:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245608#M15305</guid>
      <dc:creator>tom_frotscher</dc:creator>
      <dc:date>2015-09-30T11:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable drilldown via javascript in an HTML dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245609#M15306</link>
      <description>&lt;P&gt;I think the proper way would be:&lt;BR /&gt;
 - get the mvc element&lt;BR /&gt;&lt;BR /&gt;
 - change drilldown settings&lt;BR /&gt;
 - re-render the table&lt;/P&gt;

&lt;P&gt;It is little tricky at first:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var element1 = mvc.Components.get('element1');

element1.getVisualization(function(tableView) {
    tableView.settings.set('drilldown', 'none');
    tableView.table.render();
});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If You are doing this in the same script context, then You can simply use it's handler. &lt;BR /&gt;
In this example, I've created 2 buttons - on and off:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        &amp;lt;button id='drillOff'&amp;gt;Off&amp;lt;/button&amp;gt;
        &amp;lt;button id='drillOn'&amp;gt;On&amp;lt;/button&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then created the table and attached functions which change drilldown behaviour:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;            var element1 = new TableElement({
                "id": "element1",
                "drilldown": "row",
                'drilldownRedirect': false,
                "rowNumbers": "undefined",
                "wrap": "undefined",
                "managerid": "search1",
                "el": $('#element1')
            }, {
                tokens: true,
                tokenNamespace: "submitted"
            }).render();

            $('#drillOff').click(function() {
                element1.getVisualization(function(vis) {
                    vis.settings.set('drilldown', 'none');
                    vis.table.render();
                })
            })

            $('#drillOn').click(function() {
                element1.getVisualization(function(vis) {
                    vis.settings.set('drilldown', 'row');
                    vis.table.render();
                })
            })
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2015 12:41:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245609#M15306</guid>
      <dc:creator>piUek</dc:creator>
      <dc:date>2015-09-30T12:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable drilldown via javascript in an HTML dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245610#M15307</link>
      <description>&lt;P&gt;thx it work ^^&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2015 14:52:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-enable-disable-drilldown-via-javascript-in-an-HTML/m-p/245610#M15307</guid>
      <dc:creator>sfatnass</dc:creator>
      <dc:date>2015-09-30T14:52:17Z</dc:date>
    </item>
  </channel>
</rss>

