EasyUI Forum
April 19, 2024, 07:16:11 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 single selection and onlyLeafCheck  (Read 4811 times)
cjytxwd
Newbie
*
Posts: 5


View Profile Email
« on: May 10, 2018, 08:14:25 PM »

I want to use ComboTree to select single leaf node.
Code:
$('#testcombotree').combotree({
    multiple: flase,
    checkbox: true,
    cascadeCheck: false,
    onlyLeafCheck: true
})
But the checkbox doesn't appear, and I can select non-leaf node. Is there a way to select or check single leaf node?
« Last Edit: May 10, 2018, 08:16:06 PM by cjytxwd » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 11, 2018, 01:06:20 AM »

Please try this code:
Code:
$('#cc').combotree({
multiple: true,
onlyLeafCheck: true,
onCheck: function(node, checked){
var cc = $(this).combotree('combo');
$(cc).combotree('hidePanel');
$(cc).combotree('setValue', checked?node.id:null);
}
})
Logged
cjytxwd
Newbie
*
Posts: 5


View Profile Email
« Reply #2 on: May 11, 2018, 01:19:11 AM »

 :DThat works perfect! Thank you stworthy!
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!