GetStoreItem function
Normally, layout variables return to their configured initial values when a Deltav Live user performs a Refresh Configuration online. However, by calling AddStoreItem() in a layout's "OnClose" event handling script and GetStoreItem() in a layout's "OnOpen" event handling script, any layout-scope data that was called by AddStoreItem() when the layout was closed is retrieved again by GetStoreItem() when the refreshed layout reopens.
- Arguments
- 1
- Return values (any)
-
- The primitive value or object that was stored, if a data item with a matching key string supplied by an previous AddStoreItem() is present.
- Otherwise, the configured default value.
- Syntax
DL.GetStoreItem(key string)- Examples
-
Example Result If you want to retrieve the value for the layout-scope variable, MyVar, when the layout configuration is refreshed, you could use the following expression in the layout's "OnOpen" event handling script.let temp = DL.GetStoreItem("Lyt.MyVar"); if (temp !== undefined) Lyt.MyVar = temp; // recover it if in the store // else keep the initial value configured for my variableWhen the DeltaV Live user clicks the Refresh Configuration button, the variable, MyVar, retrieves the value stored by AddStoreItem().