How to get msg when a dashboard is displayed

Hello,
To get a message when a dashboard/widget is displayed by user, I use a template node with this code:

<script>
    (function() {
    (function(scope) {
        scope.send({payload: "preload"}); // this gets sent when the view is opened in the browser
    })(scope);
})();
</script>

So if I open the dashboard that hold the template, I have at least 3 messages (sometimes 4/5 msg) from the template, most of them have undefine socketid, and some have socketid.

I don't know why this template have this beahvior, is there someone to explain why there's several message coming out the template ?

You would be best adding an event listener
This post may help

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.