<script>
// Get the modal
var modal = document.getElementById('myModal');
// Get the button that opens the modal
var btn = document.getElementById("myBtn");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
Those variables need to be set to something as they are used to make the requester?
Ooh boy, I forgot about that for a moment. I’m going to link you some manuals. These were mentioned last month in other topics, but as far as I know there are no existing ui nodes to do this. Meaning if you want the functionality you will have to program it yourself. Which means HTML and JavaScript.
This however is not beginner level. I’d say it’s intermediate but to understand what you’re doing you will need a bit of experience with basics. So I’m going to link a few different things, and it’s up to you if you’re willing to go that way.
Here’s a CodeAcademy starter course for JavaScript. I’d say that, as long as you’re not planning to write custom nodes, blocks 1-8 and 12-14 should give you most regular things to use in function and template nodes. You won’t have to worry about the transpiling down from block 10, the things covered in this course are all supported in Node-RED without additional steps.
For the code from reply 8, understanding of the HTML block model/DOM is needed. Remember the stacking wooden figurines comparison I made in the other thread? Exactly like that. The document.getElementById call searches for an element from the html added to the template with the id attribute set to that value.
W3Schools has a decent tutorial to get started with HTML. To understand what is going on here/things that might be useful for understanding other Node-RED topics too.
You don't need to inject template nodes. Just add a template node, copy & paste the code from the modal example, ok, deploy, refresh dashboard and you will get a button. Click it and you should get a modal window.
Yeah, I sort of get that, but I guess I just wanted to be sure the node was "invoked".
So...... That aside (my stuff). You say, stick the node in a flow and deploy.
I will get a button.... Where?
Click on it (the button I'm guessing) and I should get a modal window.
As there is no sign of said button, I am kinda lost.
(But that is status-quo for me.)
(Edit)
Ok, silly me.
Look in the node's option.
Found it.
Shall continue exploring.