Home › Forums › KX Solutions › Dashboards – action triggers on page load › Re: Dashboards – action triggers on page load
-
Hi Nick,
You could try passing in a boolean viewstate triggerEnabled to your virtual datasource, which has a default value as false when the page loads to prevent it clearing.
Something like:
function (x, triggerEnabled, callback){ if(!triggerEnabled) { callback(x) // i.e. just return x without modifying } else { callback ({ // i.e. your custom clear logic }); } }
Set the viewstate to true when you actually want to clear the viewstates.
You can also map an output viewstate to reset the triggerEnabled viewstate to false after execution.
Hope this helps!
Cheers,
David