jsTree : How to get all leaf nodes from jstree?

javascript, jquery, jquery-plugins, jquery-selectors, jstree

Solution

Something like this?

$('.jstree-leaf').each(function(){
  var id   = $(this).attr('id');
  var text = $(this).children('a').text();
});

Problem

I want to get all leaf-nodes(ID & text of node) from jsTree ? I am not using checkbox ui : jsTree. ``` Root -----A -----A1 -----A1.1 -----A2 -----A2.1 -----B -----B2 -----C -----C1 -----C1.1 ``` I want list of leaf nodes from jsTree. Expected Output : [A1.1, A2.1, B2, C1.1 ] Any help or guidance in this matter would be appreciated.

Original source