JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://www.jeasyui.com/easyui/themes/metro-blue/easyui.css">
<script src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<button id="btn1">TriggerSelect</button>
<button id="btn2">TriggerClick</button>
<br>
<input id="cc" style="width:200px"></input>
<div id="info"></div>
JavaScript
var data = [{
"id":1,
"text":"My Documents",
"children":[{
"id":11,
"text":"Photos",
"state":"closed",
"children":[{
"id":111,
"text":"Friend"
},{
"id":112,
"text":"Wife"
},{
"id":113,
"text":"Company"
}]
},{
"id":12,
"text":"Program Files",
"children":[{
"id":121,
"text":"Intel"
},{
"id":122,
"text":"Java",
"attributes":{
"p1":"Custom Attribute1",
"p2":"Custom Attribute2"
}
},{
"id":123,
"text":"Microsoft Office"
},{
"id":124,
"text":"Games",
"checked":true
}]
},{
"id":13,
"text":"index.html"
},{
"id":14,
"text":"about.html"
},{
"id":15,
"text":"welcome.html"
}]
}]
$('#cc').combotree({
data: data,
onSelect: function(node){
$('#info').prepend('<p>Select: '+node.text+'</p>');
},
onClick: function(node){
$('#info').prepend('<p>Click: '+node.text+'</p>');
}
});
$('#btn1').bind('click',function(){
var value = 122;
var t = $('#cc').combotree('tree');
var node = t.tree('find',value);
if (node){
t.tree('select',node.target);
}
});
$('#btn2').bind('click',function(){
var value = 124;
var t = $('#cc').combotree('tree');
var node = t.tree('find',value);
if (node){
$(node.target).trigger('click');
}
});