EasyUI Forum
April 29, 2024, 04:53:49 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Combotree - how to prevent selection of group headings  (Read 6481 times)
Quarkrunner
Newbie
*
Posts: 4


View Profile
« 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.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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.
  }
});
Logged
Quarkrunner
Newbie
*
Posts: 4


View Profile
« Reply #2 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?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!