r25048: From the archives (patch found in one of my old working trees):
[jelmer/samba4-debian.git] / webapps / qooxdoo-0.6.5-sdk / frontend / application / sample / source / html / test / TreeVirtual_1.html
1 <html>
2 <head>
3   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4   <title>qooxdoo &raquo; Demo &raquo; Sample</title>
5   <link type="text/css" rel="stylesheet" href="../../css/layout.css"/>
6   <!--[if IE]>
7   <link type="text/css" rel="stylesheet" href="../../css/layout_ie.css"/>
8   <![endif]-->
9   <script type="text/javascript" src="../../script/sample.js"></script>
10 </head>
11 <body>
12   <script type="text/javascript" src="../../script/layout.js"></script>
13
14   <div id="demoDescription">
15   <p>
16     An example of using the Virtual Tree widget with addBranch() and addLeaf()
17   </p>
18   </div>
19
20   <script type="text/javascript">
21   qx.core.Init.getInstance().defineMain(function()
22   {
23     var d = qx.ui.core.ClientDocument.getInstance();
24
25
26     var horiz =  new qx.ui.layout.HorizontalBoxLayout;
27     
28     horiz.setPadding(10);
29     horiz.set({
30         left:20, right:10, height:"100%", spacing:20
31     });
32
33     var tree = new qx.ui.treevirtual.TreeVirtual(["Objects", "Date", "ID"]);
34     with (tree){
35         setHeight ("100%");
36         setWidth(900);
37         setColumnWidth(0, 400)
38         setColumnWidth(1, 200);
39         setColumnWidth(2, 50);
40     };
41
42     var data_model = tree.getDataModel ();
43
44     var object_folder =
45         data_model.addBranch (null, 
46                               "Test", 
47                               false);
48
49     data_model.addLeaf (object_folder, 
50                         "Test") ;
51     
52     data_model.setData();       
53
54     if (false)
55     {
56         d.add (tree);
57     }
58     else
59     {
60         horiz.add (tree);
61         d.add (horiz);
62     }
63
64   });
65   </script>
66 </body>
67 </html>