<?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 do you populate dropdown via javascript? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-populate-dropdown-via-javascript/m-p/382442#M25056</link>
    <description>&lt;P&gt;Hi, &lt;BR /&gt;
the problem is that i`m trying to integrate third-part library and i use js stack and i need to do it via javascript. is there any way? &lt;/P&gt;</description>
    <pubDate>Tue, 13 Nov 2018 07:12:28 GMT</pubDate>
    <dc:creator>bizsplunk</dc:creator>
    <dc:date>2018-11-13T07:12:28Z</dc:date>
    <item>
      <title>How do you populate dropdown via javascript?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-populate-dropdown-via-javascript/m-p/382440#M25054</link>
      <description>&lt;P&gt;hi all, &lt;/P&gt;

&lt;P&gt;can somebody help with populating a dropdown list via JavaScript? My goal is to pass search results to allow to choose it in dropdown "choices " list. &lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;

&lt;P&gt;code is like: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
        "splunkjs/mvc",
        "splunkjs/mvc/searchmanager",
        "splunkjs/mvc/dropdownview",
        "splunkjs/mvc/simplexml/ready!"
    ], function(
        mvc,
        SearchManager,
        DropdownView,
    ) {
    var ddsearch = new SearchManager({
            id: "ddsearch2",
            preview: true,
            cache: true,
            search: "| inputlookup earthquakes.csv | table Region | dedup Region | head 6"
        });

        var dropdown1 = new DropdownView({
            id: "dropdown1",
        labelField: "Region",
            valueField: "Region",
            default: "All",
            value: mvc.tokenSafe("$ddtok$"),
            el: $("#dropdown1")
        }).render();
    })
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Nov 2018 14:08:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-populate-dropdown-via-javascript/m-p/382440#M25054</guid>
      <dc:creator>bizsplunk</dc:creator>
      <dc:date>2018-11-12T14:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate dropdown via javascript?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-populate-dropdown-via-javascript/m-p/382441#M25055</link>
      <description>&lt;P&gt;SimpleXML can do this out of the box, via the graphical editor. If you like you can then inspect the generated JS code.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.2.1/Viz/FormEditor#Specify_dynamic_options"&gt;http://docs.splunk.com/Documentation/Splunk/7.2.1/Viz/FormEditor#Specify_dynamic_options&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 23:20:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-populate-dropdown-via-javascript/m-p/382441#M25055</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2018-11-12T23:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate dropdown via javascript?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-populate-dropdown-via-javascript/m-p/382442#M25056</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
the problem is that i`m trying to integrate third-part library and i use js stack and i need to do it via javascript. is there any way? &lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 07:12:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-populate-dropdown-via-javascript/m-p/382442#M25056</guid>
      <dc:creator>bizsplunk</dc:creator>
      <dc:date>2018-11-13T07:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate dropdown via javascript?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-populate-dropdown-via-javascript/m-p/382443#M25057</link>
      <description>&lt;P&gt;You can inspect the generated JS code in a SimpleXML dashboard to see how Splunk's doing it.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 09:47:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-populate-dropdown-via-javascript/m-p/382443#M25057</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2018-11-13T09:47:33Z</dc:date>
    </item>
  </channel>
</rss>

