我正在使用带有treeGrid选项的jqGrid。
当我尝试添加子节点时:
grid.addChildNode('1', null, { id2: 1, groupName: 'a', loaded: true, isLeaf: false, expanded: false, level: 0 });
grid.addChildNode('2', '1', { id2: 2, groupName: 'a/b', loaded: true, isLeaf: false, expanded: false, level: 1 });
grid.addChildNode('3', '2', { id2: 3, groupName: 'a/b/c', loaded: true, isLeaf: false, expanded: false, level: 2 });
grid.addChildNode('7', '2', { id2: 7, groupName: 'a/b/d', loaded: true, isLeaf: false, expanded: false, level: 2 });
grid.addChildNode('10', '3', { id2: 10, groupName: 'a/b/c/e', loaded: true, isLeaf: false, expanded: false, level: 3 });
grid.addChildNode('11', '1', { id2: 11, groupName: 'a/f', loaded: true, isLeaf: false, expanded: false, level: 1 });
我有这样的结果:
see image
这不是好结果,因为'a / b / d'应该是节点'a / b'的子节点。这个例子有什么问题?