Please help me load jquery-ui into a dashboard xml
Also, can i load the jquery-ui css inside the require.conf? in the browser console, i'm getting this error:
JQuery Version: 3.6.0 VM4289:50 Uncaught TypeError: Cannot read properties of undefined (reading 'ui') at eval (eval at <anonymous> (dashboard.js:1276:187236), <anonymous>:50:20) at Object.execCb (eval at module.exports (dashboard.js:632:662649), <anonymous>:1658:33) at Module.check (eval at module.exports (dashboard.js:632:662649), <anonymous>:874:51) at Module.eval (eval at module.exports (dashboard.js:632:662649), <anonymous>:1121:34) at eval (eval at module.exports (dashboard.js:632:662649), <anonymous>:132:23) at eval (eval at module.exports (dashboard.js:632:662649), <anonymous>:1164:21) at each (eval at module.exports (dashboard.js:632:662649), <anonymous>:57:31) at Module.emit (eval at module.exports (dashboard.js:632:662649), <anonymous>:1163:17) at Module.check (eval at module.exports (dashboard.js:632:662649), <anonymous>:925:30) at Module.enable (eval at module.exports (dashboard.js:632:662649), <anonymous>:1151:22)
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);
});
Dashboard
<dashboard script="input_slider_range.js" stylesheet="lib/jquery-ui.min.css">
<label>slider range</label>
<row>
<panel>
<html>
SLIDER
<p>
<label for="amount">Price range:</label>
<input type="text" id="amount" readonly="true" style="border:0; color:#f6931f; font-weight:bold;" />
</p>
<div id="slider-range"></div>
</html>
</panel>
</row>
</dashboard>
... View more