<?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 I load local jquery and jquery-ui library for a dashboard? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-load-local-jquery-and-jquery-ui-library-for-a-dashboard/m-p/605194#M49719</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/93915"&gt;@VatsalJagani&lt;/a&gt;&amp;nbsp; Thanks for replying back. Your assumptions are correct. I tried your recommendations but its returning the same error msg.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jul 2022 18:40:51 GMT</pubDate>
    <dc:creator>aa70627a</dc:creator>
    <dc:date>2022-07-11T18:40:51Z</dc:date>
    <item>
      <title>How do I load local jquery and jquery-ui library for a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-load-local-jquery-and-jquery-ui-library-for-a-dashboard/m-p/605006#M49698</link>
      <description>&lt;P&gt;Please help me load jquery-ui into a dashboard xml&lt;/P&gt;
&lt;P&gt;Also, can i load the jquery-ui css inside the require.conf? in the browser console, i'm getting this error:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;EM&gt;JQuery Version:&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;EM&gt;3.6.0&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;VM4289:50 Uncaught TypeError: Cannot read properties of undefined (reading 'ui')&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;at eval (eval at &amp;lt;anonymous&amp;gt; (dashboard.js:1276:187236), &amp;lt;anonymous&amp;gt;:50:20)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;at Object.execCb (eval at module.exports (dashboard.js:632:662649), &amp;lt;anonymous&amp;gt;:1658:33)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;at Module.check (eval at module.exports (dashboard.js:632:662649), &amp;lt;anonymous&amp;gt;:874:51)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;at Module.eval (eval at module.exports (dashboard.js:632:662649), &amp;lt;anonymous&amp;gt;:1121:34)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;at eval (eval at module.exports (dashboard.js:632:662649), &amp;lt;anonymous&amp;gt;:132:23)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;at eval (eval at module.exports (dashboard.js:632:662649), &amp;lt;anonymous&amp;gt;:1164:21)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;at each (eval at module.exports (dashboard.js:632:662649), &amp;lt;anonymous&amp;gt;:57:31)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;at Module.emit (eval at module.exports (dashboard.js:632:662649), &amp;lt;anonymous&amp;gt;:1163:17)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;at Module.check (eval at module.exports (dashboard.js:632:662649), &amp;lt;anonymous&amp;gt;:925:30)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;at Module.enable (eval at module.exports (dashboard.js:632:662649), &amp;lt;anonymous&amp;gt;:1151:22)&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;require.config({
    waitSeconds: 0, 
    paths: {
      'localjquery':'/static/app/myapp/lib/jquery.min',
      'jqueryui':'/static/app/myapp/lib/jquery-ui.min'
    },
    shim: {
        'jqueryui': {
            deps: ['localjquery']
        }
    }
});

require([
//     'splunkjs/ready!',
     'underscore',
     'backbone',
     'localjquery',
     'splunkjs/mvc',
     'jqueryui',
     'splunkjs/mvc/simplexml/ready!'
 ], function (_,Backbone, $,  mvc) {
     defaultTokenModel = mvc.Components.get("default");
     console.log("JQuery Version:");
     console.log(jQuery().jquery);
     console.log("JQuery-UI Version:");
     console.log($.ui.version);
});&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dashboard&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;dashboard script="input_slider_range.js" stylesheet="lib/jquery-ui.min.css"&amp;gt;
  &amp;lt;label&amp;gt;slider range&amp;lt;/label&amp;gt;  
    &amp;lt;row&amp;gt;
      &amp;lt;panel&amp;gt;
        &amp;lt;html&amp;gt;
        SLIDER
        &amp;lt;p&amp;gt;
          &amp;lt;label for="amount"&amp;gt;Price range:&amp;lt;/label&amp;gt;
          &amp;lt;input type="text" id="amount" readonly="true" style="border:0; color:#f6931f; font-weight:bold;" /&amp;gt;
        &amp;lt;/p&amp;gt;
        &amp;lt;div id="slider-range"&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;/html&amp;gt;        
      &amp;lt;/panel&amp;gt;
    &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 20:35:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-load-local-jquery-and-jquery-ui-library-for-a-dashboard/m-p/605006#M49698</guid>
      <dc:creator>aa70627</dc:creator>
      <dc:date>2022-07-08T20:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I load local jquery and jquery-ui library for a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-load-local-jquery-and-jquery-ui-library-for-a-dashboard/m-p/605052#M49699</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/97405"&gt;@aa70627&lt;/a&gt;&amp;nbsp;- Try below without require.config.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;require([
     'underscore',
     'backbone',
     './lib/jquery.min',
     'splunkjs/mvc',
     './lib/jquery-ui.min',
     'splunkjs/mvc/simplexml/ready!'
 ], function (_,Backbone, $,  mvc) {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm assuming below two files are present under your App:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;$SPLUNK_HOME/etc/&amp;lt;your-app&amp;gt;/appserver/static/&amp;lt;this-javascript-file&amp;gt;.js&lt;/LI&gt;&lt;LI&gt;$SPLUNK_HOME/etc/&amp;lt;your-app&amp;gt;/appserver/static/lib/jquery.min.js&lt;/LI&gt;&lt;LI&gt;$SPLUNK_HOME/etc/&amp;lt;your-app&amp;gt;/appserver/static/lib/jquery-ui.min.js&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!!&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jul 2022 14:03:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-load-local-jquery-and-jquery-ui-library-for-a-dashboard/m-p/605052#M49699</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-07-09T14:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I load local jquery and jquery-ui library for a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-load-local-jquery-and-jquery-ui-library-for-a-dashboard/m-p/605194#M49719</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/93915"&gt;@VatsalJagani&lt;/a&gt;&amp;nbsp; Thanks for replying back. Your assumptions are correct. I tried your recommendations but its returning the same error msg.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 18:40:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-load-local-jquery-and-jquery-ui-library-for-a-dashboard/m-p/605194#M49719</guid>
      <dc:creator>aa70627a</dc:creator>
      <dc:date>2022-07-11T18:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I load local jquery and jquery-ui library for a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-load-local-jquery-and-jquery-ui-library-for-a-dashboard/m-p/605196#M49720</link>
      <description>&lt;P&gt;Try below two options. One of them should work:&lt;/P&gt;&lt;P&gt;Option-1&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;require([
     'underscore',
     'backbone',
     '/static/app/&amp;lt;your-app-folder-name&amp;gt;/lib/jquery.min',
     'splunkjs/mvc',
     '/static/app/&amp;lt;your-app-folder-name&amp;gt;/lib/jquery-ui.min',
     'splunkjs/mvc/simplexml/ready!'
 ], function (_,Backbone, $,  mvc) {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Option-2&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;require([
     'underscore',
     'backbone',
     '{{SPLUNKWEB_URL_PREFIX}}/static/app/&amp;lt;your-app-folder-name&amp;gt;/lib/jquery.min',
     'splunkjs/mvc',
     '{{SPLUNKWEB_URL_PREFIX}}/static/app/&amp;lt;your-app-folder-name&amp;gt;/lib/jquery-ui.min',
     'splunkjs/mvc/simplexml/ready!'
 ], function (_,Backbone, $,  mvc) {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 19:10:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-load-local-jquery-and-jquery-ui-library-for-a-dashboard/m-p/605196#M49720</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-07-11T19:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I load local jquery and jquery-ui library for a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-load-local-jquery-and-jquery-ui-library-for-a-dashboard/m-p/605294#M49727</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/93915"&gt;@VatsalJagani&lt;/a&gt;&amp;nbsp; just an fyi, only option 2 will load up the js properly. Option #1 and the one from previous post wouldn't work because Js will complain about incorrect path.&lt;/P&gt;&lt;P&gt;Having said that, the issue here is that jquery ui has a dependency for jquery to load up first which is why require.conf is required with shim. I've also changed the waitTime from 0 to higher number but once the js is able to load both query and jqueryui, it throws the error noted from my first post&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 12:39:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-load-local-jquery-and-jquery-ui-library-for-a-dashboard/m-p/605294#M49727</guid>
      <dc:creator>aa70627</dc:creator>
      <dc:date>2022-07-12T12:39:11Z</dc:date>
    </item>
  </channel>
</rss>

