parentsReturns: array

Return an array with the names of all parents.

Parameters

NameTypeDescription
id {String} The id of the target node

Examples

sample

    
 Location: <div id="location" style="display: inline-block;"></div>
 <div id="tree"></div>
 <script>
     var tree = $('#tree').tree({
         dataSource: '/Locations/Get',
         select: function (e, node, id) {
             var parents = tree.parents(id);
             $('#location').text(parents.join(' / ') + ' / ' + tree.getDataById(id).text);
         }
     });
 </script>