提交 a27192f6 编写于 作者: J Joao Moreno

gridview: add view nested

上级 aa70d314
......@@ -233,6 +233,7 @@ export class GridView<T extends IView> implements IGrid<T>, IDisposable {
const newParent = new BranchNode<T>(parent.orientation);
grandParent.addChild(newParent, 20, parentIndex);
newParent.addChild(parent, 20, 0);
newParent.addChild(node, size, index);
}
}
......
......@@ -107,4 +107,24 @@ suite('GridView', function () {
gridview.dispose();
});
test('gridview addView nested', function () {
const gridview = new GridView(container);
const views = [
new TestView(20, 20),
[
new TestView(20, 20),
new TestView(20, 20)
]
];
gridview.addView(views[0] as IView, 200, [0]);
gridview.addView(views[1][0] as IView, 200, [1]);
gridview.addView(views[1][1] as IView, 200, [1, 1]);
assert.deepEqual(nodesToArrays(gridview.getViews()), views);
gridview.dispose();
});
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册