WjTreeView: Double click to open node

Posted by: phupham0310 on 12 October 2017, 2:02 pm EST

    • Post Options:
    • Link

    Posted 12 October 2017, 2:02 pm EST

    I want to re-set the event when the double click is open node. Please help.

  • Posted 12 October 2017, 8:09 pm EST

    Hi,

    You can handle dblclick event for the same. You can collapse/expand by setting isCollapsed property to false/true for selectedNode. You also need to set expandOnClick property to false.

    
    tree.expandOnClick=false;
    tree.hostElement.addEventListener("dblclick",function(e){
    	tree.selectedNode.isCollapsed=!tree.selectedNode.isCollapsed;
    });
    

    ~ Manish

  • Posted 16 October 2017, 12:56 pm EST

    Thanks you, Manish.

    But when I click on the header it does not work ?

  • Posted 16 October 2017, 5:30 pm EST

    Hi,

    Could you please elaborate a but more about your use case and the problem that you are facing. I have tested this with the fiddle given below and it seems to work as expected.

    http://jsfiddle.net/Ls8euqgo/

    Thanks,

    Abhishek

  • Posted 17 October 2017, 5:11 pm EST

    Hi,

    Please see the fiddle below, I have modified the sample accordingly

    http://jsfiddle.net/t0e4w6cn/

    Let me know if you are still facing issues.

    Thanks,

    Abhishek

  • Posted 12 December 2017, 7:40 pm EST

    I modified the sample :

    http://jsfiddle.net/Ls8euqgo/

    for action open node when click. But when click into icon arrow show expand/collapse error. Please help me !

  • Posted 13 December 2017, 10:04 pm EST

    Hi,

    If you would like to expand node on click, you may set to expandOnClick property to true . For this, you need not to handle click event.

    If you set to expandOnClick or handle click event to expand node, node expand on double click would not be work properly. Since, double click event triggered when click action occurs within a time frame which will trigger click event.

    If the issue persists, please let us know.

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels