TWaver Forums
http://twaver.servasoft.com/forum/

关于group嵌套group,浏览器特别卡问题
http://twaver.servasoft.com/forum/viewtopic.php?f=35&t=6189
Page 1 of 1

Author:  zc317788 [ 2019-11-20 15:38 ]
Post subject:  关于group嵌套group,浏览器特别卡问题

请问一下,group嵌套group 为什么浏览器这么卡呢? 最外层一个group,里面只有不到200 个group ,里面的每个group只有一个node,为什么这么卡呢?效果图如下请看附件,是我用法有问题吗?

部分代码截取:

if (null != _item.group) {
var root_group = null;
if(null != _item.rootGroup) {
root_group = createRootGroup(_item.rootGroup);
}
var group = createGroup(_item.group,_item.groupIsExpanded,_item.groupName1,_item.groupName2);
if (null != root_group) {
group.setParent(root_group);
console.log("sign");
}
if (null != group) {
node.setParent(group);
}
}




function createRootGroup(gid) {
var _rootgroup = this.box.getDataById(gid);
var _expanded = false;

if (undefined == _rootgroup) {
_rootgroup = new twaver.Group(gid);
_rootgroup.s('group.fill.color', '#F5F5F5');
_rootgroup.s('whole.alpha', 0.8);
_rootgroup.s('group.fill',true);
_rootgroup.s('group.outline.width',2);
_rootgroup.s('group.outline.pattern', 12, 3);
_rootgroup.s('group.outline.color','#ec6c00');
_rootgroup.s('select.style', 'none');
_rootgroup.s('group.shape', 'roundrect');
_rootgroup.s('group.deep', 0);
_rootgroup.s('label.font', '14px "Microsoft Yahei"');
if(undefined != gid) {
_rootgroup.setName2(gid);
}
_rootgroup.setExpanded(_expanded);

this.box.add(_rootgroup);
}
return _rootgroup;
}




function createGroup(gid,expanded,group1,group2) {
var group = this.box.getDataById(gid);
var _expanded = false;
if (undefined == group) {
var group = new twaver.Group(gid);
group.s('group.fill.color', '#F5F5F5');
group.s('whole.alpha', 0.8);
group.s('group.fill',true);
group.s('group.outline.width',2);
group.s('group.outline.pattern', 12, 3);
group.s('group.outline.color','#ec6c00');
group.s('select.style', 'none');
group.s('group.shape', 'roundrect');
group.s('group.deep', 0);
group.s('label.font', '14px "Microsoft Yahei"');
if(undefined != expanded) {
if("false" == expanded)
_expanded = false;
else if("true" == expanded)
_expanded = true;
}
if(undefined != group1) {
group.setName2(group1);
}
if (undefined != group2) {
group.setName(group2);
}
group.setExpanded(_expanded);

this.box.add(group);
}
return group;
}





if (null != root_group) {
group.setParent(root_group);
console.log("sign");
}

这段代码 console.log("sign"); 这个打印特别慢,把上面group.setParent(root_group); 去掉,加载就正常了,但是达不到嵌套的效果了,请麻烦解答一下,谢谢!

Attachments:
topo.png
topo.png [ 355.28 KiB | Viewed 27112 times ]

Page 1 of 1 All times are UTC + 8 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/
./cache/ is NOT writable.