Hello, I am trying to create buttons in the title bar that will send a msg on click.
I am using an ui_template and creating the button is no problem.
I am failing on sending the msg on click, here is my code in the ui_template:
<script>
var nodes = document.createElement('BUTTON');
nodes.addEventListener('click', this.scope.send({payload: "test"}));
nodes.innerHTML = 'NODES';
var titleBar = document.getElementById("nr-dashboard-toolbar");
titleBar.appendChild(nodes);
</script>
I tried different approaches but none worked. Does someone have experience with this?
I am thankful for any hint.