簡體   English   中英

Angular ivh-treeview默認情況下所有節點都展開

[英]Angular ivh-treeview all nodes expand by default

在AngularJS ivh-treeview上工作。

我想查看所有默認擴展的子節點。

當前,這是我的樹結構:

 $rootScope.nodes= [{
        label: 'node1',
        value: 'node1',
        enable:true,
        children: [{
            label: 'child1',
            value: 'child1',
            enable:true,
            children: [{
                label: 'child2',
                value: 'child2',
                enable:true,
            }]
        },{
            label: 'node2',
            value: 'node2',
            enable:true,
        }]
    }];

當前, child1標簽的左側有一個+號。 它也有一個子孩子,它是child2,但是我必須單擊+號來查看它。

另外,當我在child1中拖動一個節點時,我看不到它,我必須單擊+號來查看它。

我想默認查看所有子節點。 我的意思是,當我拖動一個新節點時,無需單擊+號。

我找到了一個解決方案是:

ivh-treeview-expand-to-depth =“ 2”

但是在這種情況下我們必須指定一個值...就像上面的...我想像這樣傳遞一些東西

ivh-treeview-expand-to-depth =“ *”ivh-treeview-expand-to-depth =“ infinite”

這樣,我可以在默認情況下查看所有子節點,或者當我拖動一個新節點時,它應該是可見的。

您可以使用ivh-treeview-expand-to-depth="-1"來默認擴展所有節點。 請參閱項目自述文件的“默認擴展”部分: https : //github.com/iVantage/angular-ivh-treeview#expanded-by-default 那是您要找的東西嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM