How to programatically re-render a render note from script #2106
-
I have a render note which contains an HTML note, and that HTML note contains a JS script note. I'm trying to refresh (the equivalent of the re-render action on the render note) the widget from a function inside of the JS script. I've looked at the frontend API and tried things like api.reloadNotes([id]) or api.refreshIncludedNotes(id) but it doesn't work. Am I doing something wrong? To be honest I still struggle to understand exactly how I'm supposed to use the frontend api sometimes with some of these functions, do they act on the script note, the render note, is there something extra I have to do, etc.. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For now I've just moved my initialization/rendering (which adds a bunch of HTML to the container element in my render note) into a function and added a |
Beta Was this translation helpful? Give feedback.
For now I've just moved my initialization/rendering (which adds a bunch of HTML to the container element in my render note) into a function and added a
container.innerHTML = '';
in it to clear the component every time the function is called, and whenever I want to "refresh" the widget I just call the function again and it re-draws everything.