Get checked nodes in a jsTree

Get checked nodes in a jsTree

Here is how I set up the tree, which is based on the documentation on the website:

var treeInit = { core: { data : [
       /* all my data */
    ] 
}};
treeInit.plugins = ["checkbox"];
$('tree_div').jstree(treeInit);

I have also faced the same problem with jstree version 3.0.0 . I found a simple solution after hours of surfing. Hope it help others.

var result = $('#your_tree').jstree('get_selected'); 

This line returns an array of selected values.


Share with your friend!




© 2017 TEDU LEARNING AND ENTERTAINMENT

NGUYEN MINH HOANG  

01 LE LOI ST, WARD 1, MY THO CITY, TIEN GIANG PROVINCE
Email: minhhoangtgg@gmail.com | Mobile N0:
+84 1255 022 800|

Website: http://tedu.edu.vn