Hello,
I added some Javascript functionality to my multi selections (see: https://www.advisori.de/splunk-struggles-with-multiselects-and-how-to-rule-them-all-or-at-least-some...).
The script works totally fine and works for my dashboard, until I edit the XML.
If I click edit, change some code and click either save or discard, the multi selections behave as if the script would not exist. That means the automatic option removal is not working at all anymore.
Clearing the cache locally in my browser or using the _bump endpoint solves the problem and makes the dashboard and the script work fine again - just until the XML is edited again.
Is there a better (permanent) solution except for clearing the cache after each edit?
Thanks in advance!
In any dashboard with Javascript Extensions, when you edit the XML it will not impact immediately after saving . You need to reload the dashboard again to get javascript executed. So when you edit the dashboard XML and save it , you need to reload dashboard.
If you had selected the inputs values during edit OR before edit, that values might impact the behaviour of dashboard. But it is only the time of saving XML. Again after reloading the dashboard it will work as expected.
Please try it and let me know.
Depending on what you are trying to do with the JS, you may be able to do it in SimpleXML, then you don't have to worry about JS caching. 😀
In any dashboard with Javascript Extensions, when you edit the XML it will not impact immediately after saving . You need to reload the dashboard again to get javascript executed. So when you edit the dashboard XML and save it , you need to reload dashboard.
If you had selected the inputs values during edit OR before edit, that values might impact the behaviour of dashboard. But it is only the time of saving XML. Again after reloading the dashboard it will work as expected.
Please try it and let me know.
Oh yes indeed, you are right. That works for me, thanks a lot!
So JavaScript will only be executed when initially loading the dashboard?
Yes, Javascript will be load during the initialisation of supporting javascript which will happen on fresh load of dashboard.
🙂
Thanks a lot for your explanation 😊