1

在 aci 树中构建 json 期间是否有使用 hide 选项?

{
"id":1,
"label":"Brand",
"inode":true,
"checkbox":true,
"radio":false,
"branch":[{"id":2,"label":"Acura","inode":false,"checkbox":true,"radio":false,hide":true},{"id":3,"label":"Audi","inode":false,"checkbox":true,"radio":false}]
}
4

1 回答 1

0

我搜索了整个文档,但没有找到在 aci-tree JSON 构造中添加隐藏选项的解决方案。我们可以通过 aci 树 API 处理程序进行如下操作:

$('#tree').on('acitree', function(event, api, item, eventName, options)
{
   if (eventName == 'init') 
   { 
        var firstItem = api.first();
        api.hide(firstItem);
   }
});

注意:在文档中 hidden[aciTreeHidden] 节点将是 display:block; & background-color:#ccc;,所以需要在demo.css中改为display:none。

于 2016-11-24T11:37:00.503 回答