I want to adapt a script from the XML examples to a dashboard of mine.
When I add the script="" stylesheet="" line do the XML, it works, but after changing something in the *.js, by dashboard is broken:
The search can't run, the submit button gets inactive, and the Edit Panel, Edit source buttons disappear.
Any ideas ?
If you know that you changed something in the *.js, and it broke, just go backwards and find out which change broke the dashboard.
that means your confusing the simple XML jscripts in the backend, or ignoring them all together. When the 'edit' buttons dissapear, splunk stops using those jscripts.
Honestly, I would assume the jscript is missing something and/or broken, however that's an assumption.
also, you should just have to 'share' the dashboard example apps knowledge objects in order to access things within, so make sure the permissions are set accordingly, otherwise your app won't be able to read the script.
After installing the sample app, I tried to use the script from it, just for testing.
Added to the xml:
<dashboard script="simple_xml_examples:table_cell_highlighting.js" stylesheet="simple_xml_examples:table_cell_highlighting.css">
The issuse still persist.
The sample app is shared globally, with the read permissions for everyone
Maybe try moving the desired script to:
/opt/splunk/etc/apps/<yourApp>/appserver/static?
I see you're using 'dashboard script'. The format that has worked for me on a simple xml dashboard is as follows:
<form script="yourScript1.js, yourScript2.js, yourScript3.js" stylesheet="yourStyleSheet1.css, yourStyleSheet2.css">
For the first try, I've done that, but no luck
when I added the .css file to my app itself, this began working. I was calling a single icon as opposed to the value.
I moved the .css file from it's locat (/opt/splunk/etc/app/simple_xml_reference/appserver/static) to my app:
(/opt/splunk/etc/apps/<myApp>/appserver/static)
Restart your search head after you do this, or wait (for awhile) until it takes, but your dashboard that is referencing this .css should work.