Closed evinck closed 5 months ago
Hello, could you help me with this code extract below ?
Setting the state to { opened: true } does indeed open the tree, but using { opened: false} doesn't work (the tree stays opened)
Thanks,
var allNodes = $('#json-tree').jstree(true).get_json('#', { flat: true }); allNodes.forEach(function(node) { // expand all if (document.getElementById('allExpanded').checked) { node.state = { opened: true }; } else { console.log('debug 1'); node.state = { opened : false}; } }); // Update jstree with the modified nodes $('#json-tree').jstree(true).settings.core.data = allNodes; $('#json-tree').jstree(true).refresh();
sorry wrong place for this
Hello, could you help me with this code extract below ?
Setting the state to { opened: true } does indeed open the tree, but using { opened: false} doesn't work (the tree stays opened)
Thanks,