显示AngularJS TreeView的崩溃 [英] Display AngularJS TreeView collapsed

查看:206
本文介绍了显示AngularJS TreeView的崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用角树视图。我指的是在下面的网址。

I am using angular tree-view. I am referring below url.

http://ngmodules.org/modules/angular.treeview

因为扩大它显示。但我想显示为崩溃了。点击则仅节点时,应该扩大。

It is displaying as expanded. but i want to display as collapsed. when the node is clicked then only it should expand.

请参考。

推荐答案

您必须添加崩溃:真正的像下面的示例中的每个节点

You have to add collapsed:true in each node like following example

 $scope.roleList = [
    { label : "User", id : "role1", children : [
      { label : "subUser1", id : "role11", children : [] },
      { label : "subUser2", id : "role12", children : [
        { label : "subUser2-1", id : "role121", children : [
          { label : "subUser2-1-1", id : "role1211", children : [] },
          { label : "subUser2-1-2", id : "role1212", children : [] }
        ],collapsed:true}
      ],collapsed:true}
    ], collapsed:true},

    { label : "Admin", id : "role2", children : [] },

    { label : "Guest", id : "role3", children : [] }
  ];

这篇关于显示AngularJS TreeView的崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆