There is such a structure:
--1 -a -b --2 -c -d -e -f How to make it so that when you select (select) the node of the 1st tree to remove the selection from the nodes of the 2nd tree?
There is such a structure:
--1 -a -b --2 -c -d -e -f How to make it so that when you select (select) the node of the 1st tree to remove the selection from the nodes of the 2nd tree?
It is necessary to add an onSelect handler in the initialization of the plugin for the element:
$("#tree").dynatree({ […] onSelect: function(flag, node) { // это пример из документации, но по аналогии вы можете сделать свои условия if( ! flag ) alert("You deselected node with title " + node.data.title); var selectedNodes = node.tree.getSelectedNodes(); var selectedKeys = $.map(selectedNodes, function(node){ return node.data.key; }); alert("Selected keys: " + selectedKeys.join(", ")); }, […] }); Everything worked out. In the onSelect handler, I used node.getKeyPath () to find the key of the upper parent. And check when choosing a node, the parent has changed or not, if so, remove the selection.
Source: https://ru.stackoverflow.com/questions/640636/
All Articles