Revision: 4415
          http://vexi.svn.sourceforge.net/vexi/?rev=4415&view=rev
Author:   clrg
Date:     2012-07-15 23:10:30 +0000 (Sun, 15 Jul 2012)
Log Message:
-----------
Table example as it should be (construct in JS, not XML)

Modified Paths:
--------------
    trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/table_basic.t

Modified: trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/table_basic.t
===================================================================
--- trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/table_basic.t       
2012-07-15 23:05:47 UTC (rev 4414)
+++ trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/table_basic.t       
2012-07-15 23:10:30 UTC (rev 4415)
@@ -10,54 +10,49 @@
         <lay:pad padding="10" text="A basic manually populated table" 
vshrink="true" />
         <wi:bevel form="down">
             <table id="table">
-                <head>
+                <head id="head">
                     <column text="First Name" minwidth="100" />
                     <column text="Surname" minwidth="100" />
                     <column text="Location" minwidth="200" />
+                    <column text="A" tooltip="Active" hshrink="true" 
datatype="boolean" />
                 </head>
-                <body id="body">
+                <body id="body" />
+                <!--
+                if you want to do it in XML you have to set the datatype on 
each cell
+                i.e.
+                <body>
                     <row>
-                        <cell text="Charles" />
-                        <cell text="Goodwin" />
-                        <cell text="United Kingdom" />
+                        <cell datatype="string" value="Joe" />
+                        <cell datatype="string" value="Bloggs" />
+                        <cell datatype="string" value="Timbuktu" />
+                        <cell datatype="boolean" value="true" />
                     </row>
-                    <row>
-                        <cell text="Michael" />
-                        <cell text="Goodwin" />
-                        <cell text="United Kingdom" />
-                    </row>
-                    <row>
-                        <cell text="Adam" />
-                        <cell text="Megacz" />
-                        <cell text="United States" />
-                    </row>
-                    <row>
-                        <cell text="Brian" />
-                        <cell text="Alliet" />
-                        <cell text="United States" />
-                    </row>
-                    <row>
-                        <cell text="Tupshin" />
-                        <cell text="Harper" />
-                        <cell text="United States" />
-                    </row>
-                    <row>
-                        <cell text="David" />
-                        <cell text="Crawshaw" />
-                        <cell text="Australia" />
-                    </row>
-                    <row>
-                        <cell text="Jeff" />
-                        <cell text="Buhrt" />
-                        <cell text="United States" />
-                    </row>
-                    <row>
-                        <cell text="Adam" />
-                        <cell text="Andrews" />
-                        <cell text="United States" />
-                    </row>
+                    etc
                 </body>
+                -->    
             </table>
         </wi:bevel>
+        
+        var data = [
+            ["Charles","Goodwin","United Kingdom",true],
+            ["Michael","Goodwin","United Kingdom",true],
+            ["Adam","Megacz","United States",false],
+            ["Brian","Alliet","United States",false],
+            ["Tupshin","Harper","United States",false],
+            ["David","Crawshaw","Australia",false],
+            ["Jeff","Buhrt","United States",true],
+            ["Adam","Andrews","United States",false]
+        ];
+        
+        for (var i,row in data) {
+            var r = new .row();
+//            vexi.trace(i+": "+row);
+            for (var j,celldata in row) {
+//                vexi.trace($head[j].datatype+", "+celldata);
+                r.add(new .cell($head[j].datatype, celldata));
+            }
+            $body.add(r);
+        }
+        
     </ui:box>
 </vexi>
\ No newline at end of file

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to