jQWidgets Forums
jQuery UI Widgets › Forums › General Discussions › Navigation › Tree › Tree: Display already selected node name on click of that node
Tagged: javascript tree, jQuery TreeView, jqxtree
This topic contains 7 replies, has 2 voices, and was last updated by abc 12 years, 9 months ago.
-
Author
-
Using ‘select’ method of ‘bind’ event, i displayed the name of selected node of tree, but when i click on that selected node again, it is not displaying the name …
plz tell me how to do ?
Hi abcd,
If the tree item is selected, the ‘select’ event of jqxTree will not be raised again.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
thanx for reply,i want to display that selected item again on single click…what i need to do to display it..?
any solution?Hi abcd,
As a solution, you can do the following:
<!DOCTYPE html><html lang="en"><head> <title id='Description'>jQuery Tree Sample</title> <link rel="stylesheet" href="../../jqwidgets2.4.2/jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.8.2.min.js"></script> <script type="text/javascript" src="../../jqwidgets2.4.2/jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets2.4.2/jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../jqwidgets2.4.2/jqwidgets/jqxscrollbar.js"></script> <script type="text/javascript" src="../../jqwidgets2.4.2/jqwidgets/jqxpanel.js"></script> <script type="text/javascript" src="../../jqwidgets2.4.2/jqwidgets/jqxtree.js"></script> <script type="text/javascript"> $(document).ready(function () { // Create jqxTree $('#jqxTree').jqxTree({ height: '300px', width: '300px' }); $("#jqxTree .jqx-tree-item").click(function (event) { var clickedElement = event.target; var elementName = clickedElement.innerHTML; alert(elementName); }); }); </script></head><body class='default'> <div id='jqxTree'> <ul> <li item-selected='true'>Home</li> <li item-expanded='true'>Solutions <ul> <li>Education</li> <li>Financial services</li> <li>Government</li> <li>Manufacturing</li> <li>Solutions <ul> <li>Consumer photo and video</li> <li>Mobile</li> <li>Rich Internet applications</li> <li>Technical communication</li> <li>Training and eLearning</li> <li>Web conferencing</li> </ul> </li> <li>All industries and solutions</li> </ul> </li> </ul> </div></body></html>
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
It is working well now. Thank you very much for your help.
Hi Peter,
This is not working on ipad…on single click of tree item it opens twice…
do u have any idea?Hi abcd,
Do you use the latest version of our software – 2.5?
Best Regards,
Peter StoevNo..I am using version 2.3.1
-
AuthorPosts
You must be logged in to reply to this topic.