Products | Versions |
---|---|
Spotfire Analyst | All |
When working with a DXP that includes JQuery UI customizations, specifically using functions like datepicker, the following issue may occur. The JavaScript functions work as expected when the Analyst is first started and the dxp is opened. However, upon closing and reopening the DXP (File >>Close), the JavaScript stops functioning.
Upon reloading the browser from Tools->Developer Tools, the JQueryUI implementation works again.
This issue stems from the repeated overwriting of the window.CustomJquery global variable during page changes, document openings, or closures, leading to event handler disruptions in the date picker. The problem arises due to conflicting global event handlers established by jQuery UI upon each script execution.
To address this, consider incorporating the following code snippet into the jQueryUI script responsible for including your own(custom) instances of jQuery and jQueryUI in the Text Area.
var noConflict = window.jQuery.noConflict(true); if (!window.CustomJQuery) { // Ensure global scope is populated with custom jQuery only once. window.CustomJQuery = noConflict; }
This solution aims to prevent conflicts by setting up the custom jQuery in the global scope only once.