$.post("http://xxxxxxxx.action", {
"pid" : null
}, function(json) {
let mydata = totree(json)
$('#cc').combotree({
data:mydata,
parentField : 'pid',
required: true,
onBeforeSelect: function (node) {
console.log(node)
$.post("http://xxxxxxxx.action", {
"pid" : node.id
}, function(json) {
if (node.children && node.children.length){return}
var tree = $('#cc').combotree('tree')
tree.tree('append', {
parentField : 'pid',
parent: node.target,
data: json
});
// $("#"+node.target.id).next().show()
}, "json");
// debugger;
if (!$(this).tree('isLeaf', node.target)) {
// $(this).combo("showPanel");
return false;
}
},
});
}, "json");