details:   /erp/devel/pi/rev/4864208c0ea3
changeset: 9315:4864208c0ea3
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu Dec 23 09:37:44 2010 +0100
summary:   Several changes to exportData implementation

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-grid.js
 |  32 +++++++--
 1 files changed, 23 insertions(+), 9 deletions(-)

diffs (46 lines):

diff -r 8150b054c08f -r 4864208c0ea3 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-grid.js
       Thu Dec 23 01:06:59 2010 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-grid.js
       Thu Dec 23 09:37:44 2010 +0100
@@ -19,19 +19,33 @@
 
 isc.ClassFactory.defineClass('OBGrid', isc.ListGrid);
 
+// = OBGrid =
+// The OBGrid combines common grid functionality usefull for different 
+// grid implementations.
 isc.OBGrid.addProperties({
-  exportData: function(requestProperties, additionalProperties) {
-    // var criteria = this.getCriteria();
+    
+  // = exportData =
+  // The exportData function exports the data of the grid to a file. The user 
will 
+  // be presented with a save-as dialog.
+  // Parameters:
+  // * {{{exportProperties}}} defines different properties used for 
controlling the export, currently only the 
+  // exportProperties.exportFormat is supported (which is defaulted to csv).
+  // * {{{data}}} the parameters to post to the server, in addition the filter 
criteria of the grid are posted.  
+  exportData: function(exportProperties, data) {
+    if (!data) {
+      data = {};
+    }
+    if (!exportProperties) {
+      exportProperties = {};
+    }
     var dsURL = this.dataSource.dataURL;
-    var data = {
+    isc.addProperties(data, {
         _dataSource: this.dataSource.ID,
         _operationType: 'fetch',
-        exportFormat: 'csv',
-        exportToFile: (requestProperties
-                       && requestProperties.params
-                       && requestProperties.params.exportToFile)
-    };
-    isc.addProperties(data, additionalProperties);
+        _noCount: true, // never do count for export
+        exportFormat: exportProperties.exportFormat || 'csv',
+        exportToFile: true
+    }, this.getCriteria());
     
     OB.Utilities.postThroughHiddenFrame(dsURL, data);
   }

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to