jQWidgets Forums

jQuery UI Widgets Forums General Discussions Navigation Tree Detect click on already selected item?

This topic contains 2 replies, has 2 voices, and was last updated by  jcwren 9 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Detect click on already selected item? #77858

    jcwren
    Participant

    In both jqxTree and jqxListBox, I need to be able to detect that the already selected item has been clicked again. Currently, the ‘select’ event only fires when an item other than the currently selected one is selected. Is there a way to detect a click on the selected item?

    Also, it would be nice if there was a ‘toggleItem’ method that would collapse the item if it’s expanded, and expand the item if it’s collapsed.

    Thanks,
    –jc

    Detect click on already selected item? #77888

    ivailo
    Participant

    Hi jcwren,

    You can use this approach about:

    $("#jqxTree").on('click', ".jqx-tree-item-selected", function () {
    			console.log("Click on selected item");
       });

    About ‘toggleItem’ method you can create your custom logic with collapseItem and expandItem methods.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Detect click on already selected item? #77979

    jcwren
    Participant

    Thanks, that’s exactly what I needed.

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

You must be logged in to reply to this topic.