diff options
Diffstat (limited to 'webapps/qooxdoo-0.6.5-sdk/frontend/application/sample/source/html/example/TreeVirtual_1.html')
-rw-r--r-- | webapps/qooxdoo-0.6.5-sdk/frontend/application/sample/source/html/example/TreeVirtual_1.html | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/application/sample/source/html/example/TreeVirtual_1.html b/webapps/qooxdoo-0.6.5-sdk/frontend/application/sample/source/html/example/TreeVirtual_1.html new file mode 100644 index 0000000000..b92df15d4f --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/application/sample/source/html/example/TreeVirtual_1.html @@ -0,0 +1,84 @@ +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>qooxdoo » Demo » Sample</title> + <link type="text/css" rel="stylesheet" href="../../css/layout.css"/> + <!--[if IE]> + <link type="text/css" rel="stylesheet" href="../../css/layout_ie.css"/> + <![endif]--> + <script type="text/javascript" src="../../script/sample.js"></script> +</head> +<body> + <script type="text/javascript" src="../../script/layout.js"></script> + + <div id="demoDescription"> + <p>Test large trees. This one adds a Spam branch with 3000 leaf nodes.</p> + </div> + + <script type="text/javascript"> + qx.core.Init.getInstance().defineMain(function() + { + var d = qx.ui.core.ClientDocument.getInstance(); + + // tree + var tree = new qx.ui.treevirtual.TreeVirtual("Tree"); + with (tree) + { + set({ + left : 10, + top : 30, + width : 400, + bottom : 30, + border : qx.renderer.border.BorderPresets.getInstance().thinInset + }); + setColumnWidth(0, 400); + setAlwaysShowOpenCloseSymbol(true); + }; + + d.add(tree); + + // tree data model + var dataModel = tree.getDataModel(); + + var te1 = dataModel.addBranch(null, "Desktop", true); + dataModel.setState(te1, + { + labelStyle : "background-color: red; color: white;" + }); + + var te; + + dataModel.addBranch(te1, "Files", true); + + te = dataModel.addBranch(te1, "Workspace", true); + dataModel.addLeaf(te, "Windows (C:)"); + dataModel.addLeaf(te, "Documents (D:)"); + + dataModel.addBranch(te1, "Network", true); + + te = dataModel.addBranch(te1, "Trash", true); + dataModel.setState(te, + { + cellStyle : "background-color: cyan;" + }); + + + var te2 = dataModel.addBranch(null, "Inbox", true); + + te = dataModel.addBranch(te2, "Spam", false); + + for (var i = 1; i < 3000; i++) + { + dataModel.addLeaf(te, "Spam Message #" + i); + } + + dataModel.addBranch(te2, "Sent", true); + dataModel.addBranch(te2, "Trash", true); + dataModel.addBranch(te2, "Data", true); + dataModel.addBranch(te2, "Edit", true); + + dataModel.setData(); + }); + </script> +</body> +</html> |