<?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: JavaScript Error on Dashboard Load in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/JavaScript-Error-on-Dashboard-Load/m-p/671897#M55003</link>
    <description>&lt;P&gt;I know of one file we have (multifix.js)&lt;BR /&gt;&lt;BR /&gt;We use it to modify the behavior of multi-select filters.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/*************************************************************************************
Multiselect Behavior Modification
multifix.js v0.2

Automatically removes 'All' option in multiselect fields when a value is selected and
remove individual values when 'All' is re-selected. 

Any multiselect with an CSS id of multi_1 - multi_15 will function in this way if 
the script is included or the app's dashboard.js or directly.
*************************************************************************************/

require(['splunkjs/mvc', 'splunkjs/mvc/simplexml/ready!'], function (mvc) {
    $(document).ready(function () {
        var selection = [];

        for (var i = 1; i &amp;lt; 16; i++) {
            multiFixer('multi_' + i);
        }

        function multiFixer(fieldId) {
            var multi = splunkjs.mvc.Components.getInstance(fieldId);
            if (typeof multi !== 'undefined' &amp;amp;&amp;amp; multi !== 'undefined') {
                multi.on('change', function () {
                    selection = multi.val();
                    if (selection.length &amp;gt; 1 &amp;amp;&amp;amp; ~selection.indexOf('*')) {
                        if (selection.indexOf('*') == 0) {
                            selection.splice(selection.indexOf('*'), 1);
                            multi.val(selection);
                            multi.render();
                        } else {
                            multi.val('*');
                            multi.render();
                        }
                    }
                });
            }
        }
    });
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2023 13:11:36 GMT</pubDate>
    <dc:creator>jason_hotchkiss</dc:creator>
    <dc:date>2023-12-14T13:11:36Z</dc:date>
    <item>
      <title>JavaScript Error on Dashboard Load</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/JavaScript-Error-on-Dashboard-Load/m-p/671792#M54997</link>
      <description>&lt;P&gt;Hello -&lt;BR /&gt;&lt;BR /&gt;I have several dashboards that are presenting the user with a pop up box&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screenshot 2023-12-13 140819.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28500i297409B5011F06CE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-12-13 140819.png" alt="Screenshot 2023-12-13 140819.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Screenshot 2023-12-13 140819.png&lt;/span&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reviewing the Browser Console, I see the following:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screenshot 2023-12-13 140730.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28501i35CAA218A234F19E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-12-13 140730.png" alt="Screenshot 2023-12-13 140730.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Screenshot 2023-12-13 140730.png&lt;/span&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;The culprit seems to be common.js&lt;BR /&gt;&lt;BR /&gt;The dashboard is already using the version=1.1, that I have seen in other posts.&amp;nbsp; The dashboard doesn't reference any .js scripts nor does it use any lookups to generate results.&lt;BR /&gt;&lt;BR /&gt;&amp;lt;form version="1.1" hideEdit="false"&amp;gt;&lt;BR /&gt;&lt;BR /&gt;Any suggestions are appreciated.&amp;nbsp; Thank you.&lt;BR /&gt;&lt;BR /&gt;However, this issue persists.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 19:16:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/JavaScript-Error-on-Dashboard-Load/m-p/671792#M54997</guid>
      <dc:creator>jason_hotchkiss</dc:creator>
      <dc:date>2023-12-13T19:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript Error on Dashboard Load</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/JavaScript-Error-on-Dashboard-Load/m-p/671804#M54998</link>
      <description>&lt;P&gt;Does it happen for all users or just some?&lt;/P&gt;&lt;P&gt;If so, it could be cached JS&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 21:37:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/JavaScript-Error-on-Dashboard-Load/m-p/671804#M54998</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-12-13T21:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript Error on Dashboard Load</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/JavaScript-Error-on-Dashboard-Load/m-p/671810#M54999</link>
      <description>&lt;P&gt;It happens for all users.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 22:26:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/JavaScript-Error-on-Dashboard-Load/m-p/671810#M54999</guid>
      <dc:creator>jason_hotchkiss</dc:creator>
      <dc:date>2023-12-13T22:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript Error on Dashboard Load</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/JavaScript-Error-on-Dashboard-Load/m-p/671833#M55001</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226579"&gt;@jason_hotchkiss&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;QQ:&amp;nbsp; Any custom JS you are using across dashboards?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;KV&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 05:13:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/JavaScript-Error-on-Dashboard-Load/m-p/671833#M55001</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2023-12-14T05:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript Error on Dashboard Load</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/JavaScript-Error-on-Dashboard-Load/m-p/671897#M55003</link>
      <description>&lt;P&gt;I know of one file we have (multifix.js)&lt;BR /&gt;&lt;BR /&gt;We use it to modify the behavior of multi-select filters.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/*************************************************************************************
Multiselect Behavior Modification
multifix.js v0.2

Automatically removes 'All' option in multiselect fields when a value is selected and
remove individual values when 'All' is re-selected. 

Any multiselect with an CSS id of multi_1 - multi_15 will function in this way if 
the script is included or the app's dashboard.js or directly.
*************************************************************************************/

require(['splunkjs/mvc', 'splunkjs/mvc/simplexml/ready!'], function (mvc) {
    $(document).ready(function () {
        var selection = [];

        for (var i = 1; i &amp;lt; 16; i++) {
            multiFixer('multi_' + i);
        }

        function multiFixer(fieldId) {
            var multi = splunkjs.mvc.Components.getInstance(fieldId);
            if (typeof multi !== 'undefined' &amp;amp;&amp;amp; multi !== 'undefined') {
                multi.on('change', function () {
                    selection = multi.val();
                    if (selection.length &amp;gt; 1 &amp;amp;&amp;amp; ~selection.indexOf('*')) {
                        if (selection.indexOf('*') == 0) {
                            selection.splice(selection.indexOf('*'), 1);
                            multi.val(selection);
                            multi.render();
                        } else {
                            multi.val('*');
                            multi.render();
                        }
                    }
                });
            }
        }
    });
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 13:11:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/JavaScript-Error-on-Dashboard-Load/m-p/671897#M55003</guid>
      <dc:creator>jason_hotchkiss</dc:creator>
      <dc:date>2023-12-14T13:11:36Z</dc:date>
    </item>
  </channel>
</rss>

