So,
Here is a source
<ul>
<li id="1">
<a href="#">
Product root
</a>
<ul>
<li id="2">
<a href="#">
Electronicis
</a>
<ul>
<li id="445">
<a href="#">
Computers
</a>
<ul>
<li id="446">
<a href="#">
SSD
</a>
</li>
</ul>
<ul>
<li id="447">
<a href="#">
GPU
</a>
</li>
</ul>
<ul>
<li id="448">
<a href="#">
MoBo
</a>
</li>
</ul>
</li>
</ul>
<ul>
<li id="449">
<a href="#">
Navigation
</a>
</li>
</ul>
</li>
</ul>
<ul>
<li id="3">
<a href="#">
Whatever
</a>
</li>
</ul>
</li>
</ul>
Nothing fancy just couple of nested lists...
And here is my load script for jsTree
$("#jsTreeContainer")
.jstree({
"plugins": ["themes", "html_data", "ui" , "search"]
})
.bind("select_node.jstree", function(event, data) {
var selectedObj = data.selected;
alert(selectedObj.attr("id"));
})
.delegate("a", "click", function (event, data) { event.preventDefault(); });
});
What I would like to accomplish now is, to open node "Navigation" (id: 449) on page load. I've tried initally_open, initally_select parameters with no luck, I've even tried fiddling with search plugin, again no luck.
Has anyone managed to accomplish this, and how?
This must be a very common request but I can't find a solution for it.
I'm using master branch from gitHub, here... https://github.com/vakata/jstree
Cheers, T.