Browse Source

Merge pull request #1271 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit '9511dd415dc2caa2e5057d1edb2c16981c664244':
  DEC-12318 fix: halfCheck主动更新的问题
es6
windy 5 years ago
parent
commit
6641ae5a0a
  1. 14
      src/base/tree/ztree/asynctree.js
  2. 4
      src/base/tree/ztree/treerender.service.js

14
src/base/tree/ztree/asynctree.js

@ -165,21 +165,27 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
}
function getNodes(times) {
function getNodes(options) {
// console.log(times);
options = options || {};
var parentValues = treeNode.parentValues || self._getParentValues(treeNode);
var op = BI.extend({}, o.paras, {
id: treeNode.id,
times: times,
times: options.times,
parentValues: parentValues.concat(self._getNodeValue(treeNode)),
checkState: treeNode.getCheckStatus()
});
}, options);
o.itemsCreator(op, complete);
}
// 展开节点会将halfCheck置为false以开启自动计算半选, 所以第一次展开节点的时候需要在置为false之前获取配置
var checkState = treeNode.getCheckStatus();
if (!treeNode.children) {
setTimeout(function () {
getNodes(1);
getNodes({
times: 1,
checkState: checkState
});
}, 17);
}
},

4
src/base/tree/ztree/treerender.service.js

@ -96,7 +96,9 @@
var nodeList = this.nodeLists[tId];
nodeList.options.times++;
nodeList.locked = true;
nodeList.populate(nodeList.options.times);
nodeList.populate({
times: nodeList.options.times
});
}
},

Loading…
Cancel
Save