aidanmountford / aidanmountford-html-panel

Grafana panel for rendering data aware HTML
MIT License
12 stars 5 forks source link

Referencing Variables in HTML Plugin #4

Open DavidEnriqueNieves opened 4 years ago

DavidEnriqueNieves commented 4 years ago

Hello. I am trying to get this Grafana plugin to be able to change some of the attributes of the elements depending on what a javascript variable is. My end goal is to have a button's href change dynamically based on how the user selects the buttons in the html.

Now, my first instinct was to use something like document.getElementById and change the attributes of the button, but that doesn't seem to work in this plugin. Now, I know that the overview page mentions using lines such as these:

htmlnode.innerHTML = "Hello World";

to change the inner html of the panel, but I still have not figured out how to change these sources dynamically. I would also like to know how to reference the panel data links in the html content of the panel.