Revision: 2020
          http://vexi.svn.sourceforge.net/vexi/?rev=2020&view=rev
Author:   clrg
Date:     2007-08-07 01:27:06 -0700 (Tue, 07 Aug 2007)

Log Message:
-----------
lazytable datatype hackery [FIX THIS PROPERLY]

Modified Paths:
--------------
    widgets/trunk/org.vexi.widgets/src/org/vexi/lib/widget/lazytable.t

Modified: widgets/trunk/org.vexi.widgets/src/org/vexi/lib/widget/lazytable.t
===================================================================
--- widgets/trunk/org.vexi.widgets/src/org/vexi/lib/widget/lazytable.t  
2007-08-06 17:21:44 UTC (rev 2019)
+++ widgets/trunk/org.vexi.widgets/src/org/vexi/lib/widget/lazytable.t  
2007-08-07 08:27:06 UTC (rev 2020)
@@ -92,10 +92,36 @@
                     c.display = th_head[j].display;
                     c.width = th_head[j].width;
                     var d = data[i][j];
+                    var h = th_head[j];
                     if (typeof(d) == "object")
                     {
-                        c.text = d.show ? d.show : d.value;
-                        c.value = d.value;
+                        // FIXME: move/abstract somewhere else
+                        if (d.value!="" and h.datatype == "datetime")
+                        {
+                            //var v = vexi.date(d.value);
+                            var v = ""+d.value;
+                            c.value = ""+d.value;
+                            if (h.showtype == "date")
+                                //c.text = 
v.getDate()+"-"+(v.getMonth()+1)+"-"+v.getYear();
+                                c.text = 
v.substring(8,10)+"-"+v.substring(5,7)+"-"+v.substring(0,4);
+                            else if (h.showtype == "time")
+                                //c.text = v.getHours()+":"+v.getMinutes();
+                                c.text = v.substring(11,16);
+                            else c.text = ""+d.value;
+                        }
+                        else if (h.datatype == "float")
+                        {
+                            var v = d.value == "" ? 0.0 : 
vexi.string.parseFloat(d.value);
+                            c.value = v;
+                            if (h.showtype == "time")
+                                c.text = vexi.math.floor(v * 60)+" mins";
+                            else c.text = v;
+                        }
+                        else
+                        {
+                            c.text = d.show ? d.show : d.value;
+                            c.value = d.value;
+                        }
                     }
                     else c.text = d;
                     if(!rowtemplate)r[r.numchildren] = c;


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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to