I am using JSTree in my application with the following code.
this.CreateTreeView = function () { $('#jstree_demo_div').jstree({ 'core': { 'multiple': false, 'data': [ { "id": "ajson1", "parent": "#", "text": "Simple root node" }, { "id": "ajson2", "parent": "#", "text": "Root node 2" }, { "id": "ajson3", "parent": "ajson2", "text": "Child 1" }, { "id": "ajson4", "parent": "ajson2", "text": "Child 2" }, ] } }); }
As shown in my code, I am trying to disable multiple selection.
Now when I use the following code to select node.
$("#jstree_demo_div").jstree().select_node("ajson3"); $("#jstree_demo_div").jstree().select_node("ajson4");
However, it selects as node. Thus, it becomes like multiple selection from Javascript.
I ask this question only to confirm that this is the correct JSTree work?
I know that I can deselect all nodes before selecting any node using the deselect_all function.
But for me, if the multiple selection is set to false, then when choosing a node from javascript, you should also select only one node.
Please correct me if I am wrong.
javascript jquery jstree
Nirav kamani
source share