I have a treeview which is implemented using jquery Treeview version 1.4. TreeView is Implemented as below
<div id="container">
<ul id="outerlist">
<li>
<span>level-1</span>
<ul>
<li>
<span>level-2</span>
<ul>
<li>
<input type="radio" name="lastnode" value="125" onclick="somefunction()" />
<span>lastnodetext</span>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
What i need is ,onload the lastnode radiobutton to be checked and all its parent nodes to be expanded (note :there are multiple levels and radiobuttons in the tree).
Below is the code that i have used acheive this
$('#container').find(':radio').each(function (index, value) {
var $this = $(this);
if ($this.val() != undefined && $this.val() == "125") {
$this.attr('checked', 'checked');
$(this).parents('ul').show();
return false;
}});
This code works perfectly fine in terms of selecting the radiobutton and expanding the level-2 and level-1 nodes. Although the Image (+ or -) does not change. How can i achieve this
Thanks in Advance!!