jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree Expand TreeView Item on Single Click

This topic contains 6 replies, has 3 voices, and was last updated by  Richard 12 years, 7 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • Expand TreeView Item on Single Click #1154

    donasolma
    Member

    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?

    Expand TreeView Item on Single Click #1183

    Peter Stoev
    Keymaster

    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 Stoev

    Expand TreeView Item on Single Click #9506

    Richard
    Member

    Hi 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.

    Expand TreeView Item on Single Click #9542

    Peter Stoev
    Keymaster

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Expand TreeView Item on Single Click #9564

    Richard
    Member

    If a Tree Item is the s within the UL, then that is what I am clicking. Below is an example

    Handlebar Pkgs Softail

    Basic
    Complete
    Prewired

    The expandable item, Handlebar Pkgs Softail is not an anchor.

    Expand TreeView Item on Single Click #9661

    Richard
    Member

    Peter, 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?

    Expand TreeView Item on Single Click #9786

    Richard
    Member

    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…

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.