Ng-zorro-antd: [0.7] 建议 nz-tree 开放 NzTreeService 相应接口

Created on 30 Mar 2018  ·  9Comments  ·  Source: NG-ZORRO/ng-zorro-antd

What problem does this feature solve?

在很多数场景下,我们希望把 Tree 当成表单的一部分,所以如何获取已选中全部项成了一个刚需,而目前 NzTreeService 有足够多的方法可以帮助我完成这个事件,但我非常难得到它们。

What does the proposed API look like?

有两个方向的建议。

NzTreeComponent 提供更多日常API

例如,使用以下方法可以获得所选项(或其他)。

<nz-tree #tree></nz-tree>
@ViewChild('tree') treeComp: NzTreeComponent;
getAll() {
    this.treeComp.getSelectedNodeList();
    // 或
    this.treeComp.tree.getSelectedNodeList(); // 其中 `tree` (或其他名称)表示 `NzTreeService` 实例
}

nodes 双向绑定

用户对 Tree 的触发直接响应数据源变动。

🌈 Feature Request

Most helpful comment

好想骂人,你们有用过这个tree写过业务吗?连获取选中的节点都做不到,难道就展示个树在哪玩?图个好看??

All 9 comments

It will be better to write your issue/comment in English, so more people can understand you.
And this means that more people can help you or benefit from your issue/comment.

how to use Bi-directional binding, can you tell us in detail?

will support ngModel instead of nzTreeData @cipchk @ming311

I would like to guide nz-tree on how to support bidirectional binding?Or do I want to update this component?
@simplejason @cipchk @ming311

@wxingheng #1277

it's better to give an example of using nz-tree's two-way data binding and this component needs to add some method to operate it.
@wxingheng

好想骂人,你们有用过这个tree写过业务吗?连获取选中的节点都做不到,难道就展示个树在哪玩?图个好看??

@libgdxlover blocked.

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

Was this page helpful?
0 / 5 - 0 ratings