-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changed.jstree event is not captured #34
Comments
Hello, Thank you for your message. I've just checked my JavaScript code and then I've seen that I commented out one line in the handler of the |
Hi, |
There's nothing strange. A selection triggers the $el.on("select_node.jstree", function(e, data) {
if(inShiny) {
setShinyValue(data.instance, checkboxes);
} // modif 9/10/2023
}); My function But as I said, I commented out the call to this function in my handler of the $el.on("changed.jstree", function(e, data) {
if(inShiny) {
// Shiny.setInputValue(
// id, getNodesWithChildren(data.instance.get_json())
// );
setShinyValueSelectedNodes(data.instance, leavesOnly, checkboxes);
if(checkboxes) {
setShinyValueCheckedNodes(data.instance, leavesOnly);
}
//setShinyValue(data.new_instance); // modif 9/10/2023
}
}); I don't remember why. Perhaps because this function was called multiple times in some circumstances. |
Strange, as I would have expected https://groups.google.com/g/jstree/c/3LLvol8nx1A/m/xvoTIonFticJ However, select_all also triggers select_all.jstree. Same logic for deselect. Maybe this would be an option. |
It seems Maybe it would have been sufficient to just add the |
I just left a PR which seems to fix this. The original line didn't work but
did. (an alternative still would be listening on |
I was trying to implement a button to select / deselect all nodes. However, it seems this change is not reflected in the shiny input:
Example:
The text was updated successfully, but these errors were encountered: