tree.on("nodeclick", function (e) {
var node = e.node;
if (!e.isLeaf) {
setTimeout(function () {
var childNodes = tree.getAllChildNodes(node);
for (var i = 0, l = childNodes.length; i < l; i++) {
if(!tree.isLeaf(childNodes)){
tree.expandNode(childNodes);
}
}
}, 1)
}
})