close
.on('ready.jstree', function (e, data) {
data.instance.open_node(["id1","id2","id3"]); // 帶入node的id
data.instance.select_node(["id1","id2","id3"]); // 帶入node的id
})
--
--
轉自 https://stackoverflow.com/questions/8466370/how-to-select-a-specific-node-programmatically/23641202
全站熱搜
vakata commented on 11 Feb 2014
Set this in your data - take a look at the docs - if using HTML set a
data-jstree='{"opened":true,"selected":true}'
on the LI node, if using HTML setstate : {"opened":true,"selected":true}
You can always do this in the
ready.jstree
event too:Best regards,
Ivan