getDataSource

Returns the DataSource object to which the node belongs. Accepts a jQuery object, DOM Element or a path identifying the node.

The result of this method can be null if the node has been manually inserted (e.g. by using 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();

        // insert an item through a data source
        var ds = treeview.getDataSource([0]);
        ds.add({text: "new item"});
        ds.save();
        ds.read();
    });
</script>