r19141: add a reasonable subset of the qooxdoo runtime environment, and example appli...
[jra/samba/.git] / swat / apps / qooxdoo-examples / test / ListView_5.html
1 <html>
2 <head>
3   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4   <title>qooxdoo &raquo; Demo</title>
5   <link type="text/css" rel="stylesheet" href="../../resource/css/layout.css"/>
6   <!--[if IE]>
7   <link type="text/css" rel="stylesheet" href="../../resource/css/layout_ie.css"/>
8   <![endif]-->
9   <script type="text/javascript" src="../../script/qx.js"></script>
10 </head>
11 <body>
12   <script type="text/javascript" src="../../script/layout.js"></script>
13
14   <div id="demoDescription">
15     <p>Testing qx.ui.listview.ListView with text cells.</p>
16     <p>This qx.ui.listview.ListView will be resized with the window.</p>
17     <p>Using percents for columns.</p>
18   </div>
19
20   <script type="text/javascript">
21     qx.core.Init.getInstance().defineMain(function()
22     {
23       var ld = [];
24       var lt = [ "Image", "Text", "PDF", "Illustration", "Document" ];
25
26       for (var i=0, t; i<1000; i++)
27       {
28         t=Math.round(Math.random()*4);
29         ld.push({ name : { text : "File " + i }, size : { text : Math.round(Math.random()*100) + "kb" }, type : { text : lt[t] }, modified : { text : "Nov " + Math.round(Math.random() * 30 + 1) + " 2005" }, rights: { text : "-rw-r--r--" }});
30       };
31
32       var lc =
33       {
34         name : { label : "Name", width : "30%", type : "text" },
35         size: { label : "Size", width : "10%", type : "text", align : "right" },
36         type : { label : "Type", width : "15%", type : "text" },
37         modified : { label : "Last Modified", width : "20%", type : "text" },
38         rights : { label : "Rights", width: "15%", type : "text" }
39       };
40
41       var lv = new qx.ui.listview.ListView(ld, lc);
42
43       lv.setBorder(qx.renderer.border.BorderPresets.getInstance().shadow);
44       lv.setBackgroundColor("white");
45       lv.setLocation(20, 48);
46       lv.setRight(335);
47       lv.setBottom(48);
48
49       qx.ui.core.ClientDocument.getInstance().add(lv);
50     });
51   </script>
52 </body>
53 </html>