EventListener in dashboard-template-node

I answered another question about daterangepicker some days ago. Perhaps the solution there can help you:

https://discourse.nodered.org/t/ui-template-script-lost-after-switch-of-tab/68650