1
::我在jstree
中创建了动态树面板,但我无法隐藏树的根。当在树面板中rootVisible=false
时,根不可见,但显示状态code 200
。我怎样才能隐藏树的根?rootVisible = false不起作用
我在视图中有一个静态面板(Section1)。我为Section1定义了一个listener(afterrender.handler="LoadTree();")
。
var h=0;
function LoadTree() {
if (h < 2) {
var tree = Ext.create('Ext.tree.Panel', {
width: 400,
height: 400,
collapsed:true,
collapsible: true,
useArrows: true,
title: 'test',
id: 'Tree' + String(h),
rootVisible:false
});
tree.setRootNode({
text: 'root'
});
var root = tree.getRootNode();
for (var g = 0; g < 2; g++) {
var A= root.appendChild(
{
text: '1'
});
for (var t = 0; t <3; t++)
{
var B= A.appendChild(
{
text: '2'
});
}
}
App.Section1.add(tree);
h++;
LoadTree();
}
}
你正在使用什么版本的jsTree?代码200的状态是什么?你能提供一个你试图实现的快照吗? –
我使用版本2.3。状态码是{}。我创建了动态树面板并在for循环中添加了childNode – Mina
您可以将脚本添加到您的问题中吗? –