when I click the “Add New” button, I can see the returned value is updated, but neither the HTML representation of it, neither the data at the bottom — I need to click on the cell for it to be refreshed
when I modify a value via the “HTML form”, it does not seem to reflect anywhere. I’m not sure how reactivity works in this case. I’ve only seen examples where inputs where notebook variables :-/
Thanks for your help, it’s an amazing tool and I love how friendly this forum is.
The easiest way to get the HTML to update is to ensure that it depends explicitly on the button push. Thus, simply add the name of the button to your entretiens_html variable. Thus, the first two lines might look like so:
entretiens_html = {
add_entretien;
Here’s the result:
Since your entretiens_html is a viewof, you might be able to pull the same trick and get away with including entretiens_html in any cell that you want to update. I’m not sure exactly which cells you want to update or how you want them to update but I suspect it might be trickier than that. In that case, you might want to add an event listener using standard Javascript tools. For example, following button could be used to increment a mutable variable n:
button_with_listener = {
let b = Button('Hit me')
b.addEventListener("click", function() {
mutable n = n+1
});
return b
}
Thanks Mark, you definitely helped me to get back on track
It totally worked to remove the viewof and to declare the “Add New” as a dependency. I get it’s used for the dependency graph I’ve seen a few schemas here and there.
I still have to figure out a few things to mutate within an array, it’s still not that straightforward. I’ll work on it with a cool header later on. Thanks so much for your help so far!