[Common scripts] Script Execution Order

vividime-Club Show all floors Published on 2024-12-17 18:02:29 |Reading mode print Previous Topic Next Topic
1
Unresolved

【Common scripts】 Script Execution Order

1098 1
tell  more about Script Execution Order
reply

Using props report

Exciting comments1

vividime-Club Show all floors Published on 2024-12-17 18:03:05
When there are many components on a dashboard, scripts can be defined on the dashboard, and each component can also introduce scripts. Additionally, the properties of other scripts can be accessed within the script of one component. The final execution effect of a script is controlled by the execution timing. If the same attribute is modified, which script was last triggered will affect the final effect.
➢For example:
The background color of Table 2 has been modified on Table 1, and Table 2 has also changed its own background color. The final effect depends on whether Table1 is executed later or whether Table2 is executed later. If Table2 is executed last, the modified background color in Table2 will be displayed.
The order of the scripts on the dashboard is roughly as follows:
•Execute the "On Load' script.
•Execute the "On Change" script.
•Execute all component level scripts.
'On Load' is only executed once when the dashboard is first loaded. It can be used to initialize variables and define parameters. When there are any changes in the dashboard, 'Run on Change' will be re executed. Whenever a specific component is refreshed due to user actions (on the component itself or related components), the script on the component will be re executed. Because the execution order of scripts on all components is uncertain, it should be avoided to set the properties of another component from the script of one component.
When the dashboard is opened, the overall order of scripts, parameters, and data is as follows:
•The script 'On Load' is executed first. This script is defined on the dashboard.
•The parameters entered through the input box.
•Query data for all components.
•Script to run on change.
•Script on component.
When dashboard changes:
•The script that runs when changes occur.
•Script on component.

reply

Using props report

Advanced mode
You need to log in before you can reply to the post login | Free registration

© 2024 VIVIDATA PTE. LTD. All Rights Reserved. Privacy Statement