jQuery UI Widgets › Forums › General Discussions › Navigation › Tree › Expand TreeView Item on Single Click
Tagged: jquery tree, jQuery TreeView, jqxtree, Tree, TreeView, User Interface
This topic contains 6 replies, has 3 voices, and was last updated by Richard 13 years, 7 months ago.
-
Author
-
I’m trying to expand a TreeView item with a single mouse click. I tried the the code samples on the demo page and read the documentation but I couldn’t understand how to achieve that. Can someone help me please?
Hi donasolma,
In this scenario, you can set the ‘toggleMode’ property when you create the jqxTree and set it to ‘click’
$('#jqxTree').jqxTree({ toggleMode: 'click'});Hope this helps you.
If you have additional questions, please feel free to write us.
Best Regards,
Peter StoevHi Peter,
I added the instruction to my tree menu but it does not expand on single click. I am using the variation where the visitor can click the category name to expand the menu item. Double clicking the menu item works.Hi Richard,
Setting the ‘toggleMode’ to ‘click’ will change the toggle state of the Tree Items. Here’s a sample: http://jsfiddle.net/jqwidgets/5VM4h/. However, if your items are anchor tags, clicks will be handled by the anchor tag.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comPeter, in the example you give the entries in the tree are created using source. Must I create the tree that way or can I code the HTML for the items in the tree?
Peter, Since I have not heard from you, I made the assumption that the tree items had to be defined in source in order to get the single click working. Once I converted my <ul and <li HTML commands to the source format. It all started working properly. Not sure why the single click would not work when the tree items are hard coded as <li items.
Thanks for your help…
-
AuthorPosts
You must be logged in to reply to this topic.