Name | Type | Description | Default |
---|---|---|---|
cascadeCheck | boolean | Defines if to cascade check. | true |
cascadeCheck为false就满足你的要求。
$('#tt').tree({
url: url,
method: "GET",
checkbox: true,
lines: true,
cascadeCheck: false,
onCheck: function (node, checked) {
if (checked) {
var node1 = $(this).tree('getParent', node.target);
if (node1 != null) {
$(this).tree('check', node1.target);
}
} else {
var nodeC = $(this).tree('getChildren', node.target);
$.each(nodeC, function () {
$('#tt').tree('uncheck', this.target);
});
}
}
});