|
@@ -10,7 +10,8 @@
|
|
|
pid: 'parentId',
|
|
|
nid: 'nextId',
|
|
|
btnColumn: 1,
|
|
|
- iconCol: 'projType'
|
|
|
+ iconCol: 'projType',
|
|
|
+ nullId: -1
|
|
|
},
|
|
|
columns: [
|
|
|
{
|
|
@@ -236,7 +237,7 @@
|
|
|
that.newNodeId(node.id());
|
|
|
|
|
|
if (!parent){
|
|
|
- if (data[setting.tree.pid] === -1) {
|
|
|
+ if (data[setting.tree.pid] === setting.tree.nullId) {
|
|
|
parent = that._root;
|
|
|
} else {
|
|
|
parent = createTempNode(data[setting.tree.pid], setting);
|
|
@@ -249,7 +250,7 @@
|
|
|
}
|
|
|
node.parent = parent;
|
|
|
|
|
|
- if (!next && data[setting.tree.nid] !== -1) {
|
|
|
+ if (!next && data[setting.tree.nid] !== setting.tree.nullId) {
|
|
|
next = createTempNode(data[setting.tree.nid], setting);
|
|
|
next.parent = parent;
|
|
|
}
|
|
@@ -337,7 +338,7 @@
|
|
|
if (node.row) {
|
|
|
if (pre) {
|
|
|
_view._moveRowDom(node, pre.deepestRow());
|
|
|
- } else if (parent.id() !== -1) {
|
|
|
+ } else if (parent.id() !== setting.tree.nullId) {
|
|
|
_view._moveRowDom(node, parent.row);
|
|
|
} else if (nextSibling) {
|
|
|
_view._moveRowDomBefore(node, nextSibling.row);
|
|
@@ -348,7 +349,7 @@
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- this.e.throw('Error(information of moving node has mistake).');
|
|
|
+ this.e.throw('Error: information of moving node has mistake.');
|
|
|
}
|
|
|
};
|
|
|
|