Return an array with the names of all parents.
Parameters
Name | Type | Description |
---|---|---|
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>