getDataSourceIndex

Returns the node's index in the DataSource to which it belongs to. Accepts a jQuery object, DOM Element or a path identifying the node.

The result will be undefined if the node has been manually inserted (e.g. via append()).

<ul id="treeview">
    <li>My Project
        <ul>
            <li id="someid">js</li>
            <li>css</li>
        </ul>
        <li>index.html<li>
        <li>upload.php<li>
    </li>
</ul>

<script type="text/javascript">
    jQuery(function ($) {
        var treeview = $("#treeview").shieldTreeView().swidget();

        // prints 0
        console.log(treeview.getDataSourceIndex([0, 0]));
    });
</script>