fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [12959]


From: Nelson Guerra
Subject: [Fmsystem-commits] [12959]
Date: Tue, 07 Apr 2015 23:04:59 +0000

Revision: 12959
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12959
Author:   nelson224
Date:     2015-04-07 23:04:58 +0000 (Tue, 07 Apr 2015)
Log Message:
-----------


Added Paths:
-----------
    branches/dev-syncromind/property/js/portico/budget.basis.js

Added: branches/dev-syncromind/property/js/portico/budget.basis.js
===================================================================
--- branches/dev-syncromind/property/js/portico/budget.basis.js                 
        (rev 0)
+++ branches/dev-syncromind/property/js/portico/budget.basis.js 2015-04-07 
23:04:58 UTC (rev 12959)
@@ -0,0 +1,28 @@
+var intVal = function ( i )
+{
+       return typeof i === 'string' ?
+               i.replace(/[\$,]/g, '')*1 :
+               typeof i === 'number' ?
+                       i : 0;
+};
+                       
+var addFooterDatatable = function (oTable) 
+{
+       var api = oTable.api();
+                       
+       for(i=0;i < JqueryPortico.columns.length;i++)
+       {
+               if (JqueryPortico.columns[i]['data'] === 'budget_cost')
+               {
+                       data = api.column( i, { page: 'current'} ).data();
+                       pageTotal = data.length ?
+                               data.reduce(function (a, b){
+                                               return intVal(a) + intVal(b);
+                               }) : 0;
+                       
+                       var amount = $.number( pageTotal, 0, ',', ' ' );
+                       
+                       $(api.column(i).footer()).html("<div 
align=\"right\">"+amount+"</div>");                
+               }
+       }
+};
\ No newline at end of file




reply via email to

[Prev in Thread] Current Thread [Next in Thread]