我使用了下面的示例来填充分层结构。
http://www.jeasyui.com/documentation/treegrid.php
当最初加载时,树将全部展开。是否有任何设置是我丢失的加载树,最初全部倒塌。我尝试过“状态:‘关闭’的数据-选项,但它不起作用。
发布于 2016-06-11 15:31:45
如果使用“转换”筛选器,则可以将状态属性添加到节点。
while(toDo.length){
var node = toDo.shift(); // the parent node
// get the children nodes
for(var i=0; i<rows.length; i++){
var row = rows[i];
if (row.parentId == node.id){
var child = {id:row.id,text:row.name, state:'closed'};
if (node.children){
node.children.push(child);
} else {
node.children = [child];
}
toDo.push(child);
}
}
}https://stackoverflow.com/questions/35993868
复制相似问题