Steve Jebson
asked on
Simulate Treeview Root node click
Hi Experts,
I've found some good posts in EE on capturing some of the events but what i need to do is simulate the click on the root node of my treeview in javascript on the client. I'm hoping this is going to be simple and quick ! I've had a look around the treeview in firebug but can't see anything obvious, not to this beginner anyway ;-)
thanks
I've found some good posts in EE on capturing some of the events but what i need to do is simulate the click on the root node of my treeview in javascript on the client. I'm hoping this is going to be simple and quick ! I've had a look around the treeview in firebug but can't see anything obvious, not to this beginner anyway ;-)
thanks
By the way , which Javascript /Treeview code you are using ?
Please post some more details.
Please post some more details.
Are you using
<asp:TreeView> ???
Look at
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.treeview.nodes.aspx
<asp:TreeView> ???
Look at
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.treeview.nodes.aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
document.getElementById()
Once you have object, trigger click call
e.g
<html>
<head>
<script type="text/javascript">
function clickRoot()
{
document.getElementById('r
}
function alertMsg()
{
alert("Root was clicked!")
}
</script>
</head>
<body onload="clickRoot()">
<ul id="root" onclick="alertMsg();">Root
<li>Section 1
<ul>
<li>Test Mode Procedures</li>
<li>Diagnostic Procedures</li>
<li>Other Procedures
<ul>
<li>Log Analysis</li>
<li>Error Message Analysis</li>
<li>Miscellaneous Procedures</li>
<ul>
<li>Emergency Procedures</li>
<li>Power-Off Procedures</li>
</ul>
</ul>
</li>
</ul>
</li>
<li>Section 2
<ul>
<li>Functional Description
<ul>
<li>Power Distribution Function</li>
<li>System Ready Function</li>
<li>Emergency Stop Function</li>
</ul>
</li>
<li>Tracking Function</li>
<li>Other Functions</li>
</ul>
</li>
</ul>
</body>
</html>