Fix cell position editing and diffs
parent
8b70cb8b03
commit
594f0df1e8
|
@ -114,7 +114,7 @@ TreeGrid.prototype._setProps = function(el, props)
|
|||
el.innerHTML = props;
|
||||
else
|
||||
for (var j in this.bindProps)
|
||||
el[j] = props[j] || '';
|
||||
el[j] = props[j] !== undefined ? props[j] : '';
|
||||
}
|
||||
|
||||
// Simple cell editing
|
||||
|
@ -378,7 +378,7 @@ function TreeGridNode(node, grid, level, insertBefore, startHidden)
|
|||
var child = new TreeGridNode(node.children[i], grid, this.level+1, insertBefore, this.collapsed);
|
||||
child._index = i;
|
||||
this.children.push(child);
|
||||
if (child.key)
|
||||
if (child.key !== undefined)
|
||||
this.childrenByKey[child.key] = child;
|
||||
}
|
||||
}
|
||||
|
@ -608,7 +608,7 @@ TreeGridNode.prototype.removeChild = function(nodeOrIndex)
|
|||
return false;
|
||||
var e = this.children[nodeOrIndex].tr;
|
||||
var l = this.children[nodeOrIndex].level;
|
||||
if (this.children[nodeOrIndex].key)
|
||||
if (this.children[nodeOrIndex].key !== undefined)
|
||||
delete this.childrenByKey[this.children[nodeOrIndex].key];
|
||||
this.children.splice(nodeOrIndex, 1);
|
||||
for (var i = nodeOrIndex; i < this.children.length; i++)
|
||||
|
@ -644,7 +644,7 @@ TreeGridNode.prototype.addChildren = function(nodes, insertBefore)
|
|||
var child = new TreeGridNode(nodes[i], this.grid, this.level+1, e, this.collapsed);
|
||||
child._index = insertBefore+i;
|
||||
this.children.splice(insertBefore+i, 0, child);
|
||||
if (child.key)
|
||||
if (child.key !== undefined)
|
||||
this.childrenByKey[child.key] = child;
|
||||
}
|
||||
for (var i = insertBefore+nodes.length; i < this.children.length; i++)
|
||||
|
|
Loading…
Reference in New Issue