Function()treeNode.getCheckStatus

概述[ 依赖 jquery.ztree.excheck 扩展 js ]

获取节点 checkbox / radio 半勾选状态。[setting.check.enable = true 时有效]

初始化节点数据时,由 zTree 增加此属性,请勿提前赋值

Function 参数说明

返回值JSON

{
	checked: true, //等同于 treeNode.checked
	half: true  //规则见下表
}
setting.check.checkType = "checkbox"
treeNode.checkedtreeNode.check_Child_StatetreeNode.halfCheck half
--truetrue
 
true-1falsefalse
true0falsetrue
true1falsetrue
true2falsefalse
 
false-1falsefalse
false0falsefalse
false1falsetrue
false2falsetrue

setting.check.checkType = "radio"
treeNode.checkedtreeNode.check_Child_StatetreeNode.halfCheck half
--truetrue
 
true-1falsefalse
true0falsefalse
true2falsetrue
 
false-1falsefalse
false0falsefalse
false2falsetrue

treeNode 举例

1. 获取第一个根节点的半选状态

var treeObj = $.fn.zTree.getZTreeObj("tree");
var halfCheck = treeObj.getNodes()[0].getCheckStatus();