javascript to expand all parents of checked nodes?
90 views
Skip to first unread message
Chris
unread,
Oct 21, 2015, 9:46:52 AM10/21/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jsTree
Trying to create a button that will expand to show all of the checked nodes in the tree...
I can grab a list of all of those nodes, and I think i need to invoke open_node on them but I'm not sure how to do it..
var checkedNodes = $('#jstree').jstree("get_checked",true);
Chris
unread,
Oct 21, 2015, 1:46:32 PM10/21/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jsTree
I went with this. It uses the side effect of opening the node up to the parent, but I didn't like the additional side effect of selecting the node, so it also handles deselecting it if it wasn't already selected.
$('#toggleSelectedButton').click(function () {
var checkedNodes = $('#jstree').jstree("get_checked", true);
$.each(checkedNodes, function (index, value) {
var isSelected = $('#jstree').jstree('is_selected', value);