SuperX-Kernmodul
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

78 lines
1.7 KiB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Dojo Tree Widget Test (dynamic node creation)</title>
<script type="text/javascript">
var djConfig = {isDebug: true, debugAtAllCosts: true };
</script>
<script type="text/javascript" src="../../../dojo.js"></script>
<script type="text/javascript">
delete dojo["profile"];
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.Tree");
dojo.require("dojo.widget.TreeNode");
dojo.require("dojo.widget.TreeBasicController");
dojo.require("dojo.profile");
dojo.hostenv.writeIncludes();
</script>
<script type="text/javascript">
dojo.addOnLoad(function(){
var depth = 0;
function addChildren(title,nodeOrTree) {
//dojo.debug("addChildren to "+nodeOrTree+" depth" + depth)
depth++;
for (var i=1; i<=5; i++) {
var t = title+'.'+i
dojo.profile.start("createWidget");
var node = dojo.widget.createWidget("TreeNode", {title: t});
dojo.profile.end("createWidget");
nodeOrTree.addChild(node)
if (depth<3) {
addChildren(t, node);
}
}
//dojo.debug("out "+nodeOrTree);
depth--;
}
dojo.profile.start("createTree");
var tree = dojo.widget.createWidget("Tree");
dojo.profile.end("createTree");
document.body.appendChild(tree.domNode);
dojo.profile.start("createNodes");
addChildren('node', tree)
dojo.profile.end("createNodes");
var nodeCount = 0;
dojo.lang.forEach(tree.getDescendants(), function() { nodeCount++ });
dojo.debug("Nodes total: "+nodeCount);
dojo.profile.dump(true);
});
</script>
</head>
<body>
<h4>Test/profile fast nested nodes generation and adoptation</h4>
</body>
</html>