开发者社区> 问答> 正文

关于jquery easy UI 树控件问题。

数控件默认是全部展开的,我想把他弄成默认关闭的怎么做?
API上是这样写的:state:节点状态,'open' 或 'closed',默认:'open'。如果为'closed'的时候,将不自动展开该节点。
然后我按照他说的写:

 $(function(){   
        $('#account_ul').tree({
            lines:true,
            state:'closed', 
        }); 
    });

测试数据显示有虚线,可是还是打开的状态,怎么办?

展开
收起
小旋风柴进 2016-03-17 13:13:16 1982 0
1 条回答
写回答
取消 提交回答
  • 是数据源增加,tree的配置没有state这个配置

         [{
        "id":1,
        "state":"closed",
        "text":"Folder1",
        "iconCls":"icon-save",
        "children":[{
        "text":"File1",
        "checked":true
        },{
        "text":"Books",
        "state":"open",
        "attributes":{
        "url":"/demo/book/abc",
        "price":100
        },
        "children":[{
        "text":"PhotoShop",
        "checked":true
        },{
        "id": 8,
        "text":"Sub Bookds",
        "state":"closed"
        }]
        }]
        },{
        "text":"Languages",
        "state":"closed",
        "children":[{
        "text":"Java"
        },{
        "text":"C#"
        }]
        }]
    2019-07-17 19:05:10
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
使用TensorFlow搭建智能开发系统自劢生成App UI代码 立即下载
Fusion Design - 企业级UI解决方案揭秘 立即下载
使用TensorFlow搭建智能开发系统自动生成App UI 立即下载