0

How can I get the checked Nodes with jsTree, I have a simple code snippet but that's not work for me. It only retain the container id. Any suggestion?

   treeContainer.jstree("get_checked", null, true).each(function () {

                    alert("Selected : " + this.id);
                });
Ammar Khan
  • 2,565
  • 6
  • 35
  • 60
  • http://stackoverflow.com/questions/11049874/how-to-get-all-checked-nodes-in-jstree?rq=1 http://stackoverflow.com/questions/18268306/how-to-get-checked-nodes-in-jquery-jstree?rq=1 http://stackoverflow.com/questions/18355420/get-list-of-checked-node-ids-of-jstree?rq=1 - have a look at the "Related" column on the right hand side ----> – scrowler May 04 '14 at 21:10
  • Unfortunately, none of the trick for me. I wen through many stackoverflow question since a day, and if you check out my code, they are similar to the related example. Don't know why it is not return the list of checked id's. It just return back the container id. Any idea? – Ammar Khan May 04 '14 at 21:13
  • It looks like version 3.0 has some breaking changes. May be they changed a way to extract checked node id's but don't know how is it possible? – Ammar Khan May 04 '14 at 21:15
  • If it's returning the container, you should be able to `find()` the element you're after easily enough. What is `console.log(this)` reporting in that loop? – scrowler May 04 '14 at 21:52
  • That is the selector itself. And it contain it's own properties. What I should need to find? treeContainer.jstree("get_checked", null, true) can be call on a container – Ammar Khan May 04 '14 at 22:25
  • I want to search the whole tree and get the checked node. – Ammar Khan May 04 '14 at 22:27
  • Answer of this question is available here https://stackoverflow.com/questions/18268306/how-to-get-checked-nodes-in-jquery-jstree – Asif Nowaj Nov 03 '19 at 21:09

0 Answers0