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

Log Message:
-----------
Add neat datamap datatype hackery [STILL NEEDS MOVING]

Modified Paths:
--------------
    widgets/trunk/org.vexi.widgets/src/org/vexi/lib/widget/lazytable.t
    widgets/trunk/org.vexi.widgets/src/vexi/widget/table.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-07 12:39:28 UTC (rev 2022)
+++ widgets/trunk/org.vexi.widgets/src/org/vexi/lib/widget/lazytable.t  
2007-08-07 15:20:06 UTC (rev 2023)
@@ -66,6 +66,10 @@
         thisbox.fill2 = null;
         thisbox.fill1 = null;
         thisbox.getRowHeight = null;
+        
+        var maps = {};
+        
+        thisbox.setDataMap = function(id, map) { maps[id] = map; }
            
         /** loads a set of data into the body of a table */
         var loadDataFunc = function(data)
@@ -133,14 +137,20 @@
                                 c.text = v.substring(11,16);
                             else c.text = ""+d.value;
                         }
-                        else if (h.datatype == "float")
+                        else if (d.value!="" and h.datatype == "float")
                         {
-                            var v = d.value == "" ? 0.0 : 
vexi.string.parseFloat(d.value);
+                            var v = 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 if (h.datatype == "map")
+                        {
+                            var m = maps[h.showtype];
+                            c.value = ""+d.value;
+                            c.text = m[c.value];
+                        }
                         else
                         {
                             c.text = d.show ? d.show : d.value;

Modified: widgets/trunk/org.vexi.widgets/src/vexi/widget/table.t
===================================================================
--- widgets/trunk/org.vexi.widgets/src/vexi/widget/table.t      2007-08-07 
12:39:28 UTC (rev 2022)
+++ widgets/trunk/org.vexi.widgets/src/vexi/widget/table.t      2007-08-07 
15:20:06 UTC (rev 2023)
@@ -59,7 +59,7 @@
                                             "KeyPressed", "KeyReleased", 
"fetchData", "forceFetchData", "loadData", "setRowCount",
                                             "setFilter", "setCompoundFilter", 
"setRowTemplate", "sortAscending", "sortDescending",
                                             "setInfo", "getOffset", 
"getXOffset", "getYOffset", "setOffset", "setXOffset", "setYOffset",
-                                            "getVerticalInset", 
"getHorizontalInset", "getViewportHeight", "getViewportWidth");
+                                            "setDataMap", "getVerticalInset", 
"getHorizontalInset", "getViewportHeight", "getViewportWidth");
         
         if (widget.margin) $margin.margin = widget.margin;
         //if ($widget.padding) $pad.padding = $widget.padding;


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