在js文件中加入了网上找到的增删方法后出现的问题:
Tree.prototype.addNode = function(identifiers, options) {
this.forEachIdentifier(identifiers,options,
$.proxy(function(node, options) {
this.setAddNode(node, options);
},
this));
//*********************************************************
this.setInitialStates({ nodes: this.tree }, 0);
//**********************************************************
this.render();
}
星号包围的地方导致重新加载节点,节点每增加或减少都会刷新导致id不断扩大
因此本来点击获取到的节点id也不准确了
Tree.prototype.setInitialStates = function (node, level) {
if (!node.nodes) return;
level += 1;
var parent = node;
var _this = this;
$.each(node.nodes, function checkStates(index, node) {
//****************************************************************
// nod