EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Quarkrunner on November 03, 2013, 05:47:51 PM



Title: Combotree - how to prevent selection of group headings
Post by: Quarkrunner on November 03, 2013, 05:47:51 PM
I can't work out how to prevent users from selecting the group headings within a combotree. We want them to display so that they can be opened to reveal the children, but we need to prevent selection of the group headings themselves. Please advise.


Title: Re: Combotree - how to prevent selection of group headings
Post by: stworthy on November 03, 2013, 08:25:49 PM
The 'onBeforeSelect' event can be used to determine what nodes can be selected.
Code:
$('#cc').combotree({
  onBeforeSelect:function(node){
    if (...){return false)  // return false to prevent from selecting a node.
  }
});


Title: Re: Combotree - how to prevent selection of group headings
Post by: Quarkrunner on November 03, 2013, 08:43:33 PM
Many thanks.

As a follow up, if instead we wanted to treat clicking the group heading the same as clicking the arrow (ie. opening and closing the group), how would that be done?