EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: frankgao on August 05, 2016, 02:47:52 AM



Title: How to set the easyui-tree onDblClick expand and close the node?
Post by: frankgao on August 05, 2016, 02:47:52 AM
I need set the onDblClick expand and close the node.
How to do it? 
Thanks.


Title: Re: How to set the easyui-tree onDblClick expand and close the node?
Post by: stworthy on August 05, 2016, 05:49:59 PM
Please try this code:
Code:
$('#tt').tree({
  onDblClick: function(node){
    if (node.state == 'closed'){
      $(this).tree('expand', node.target);
    } else {
      $(this).tree('collapse', node.target);
    }
  }
})