Pman.Gnumeric.js
authorAlan Knowles <alan@akbkhome.com>
Fri, 10 Sep 2010 05:26:45 +0000 (13:26 +0800)
committerAlan Knowles <alan@akbkhome.com>
Fri, 10 Sep 2010 05:26:45 +0000 (13:26 +0800)
Pman.Gnumeric.js

index 0515a5f..187304e 100644 (file)
@@ -548,8 +548,15 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, {
         
         
     },
-    download : function(name)
+    /**
+     * download:
+     * @param {String} name  filename to downlaod (without xls)
+     * @param {String} callback  (optional) - callback to call after callback is complete.
+     */
+    download : function(name,callback)
     {
+        name = name || "Missing_download_filename";
+        
         var ser = new XMLSerializer();
         var x = new Pman.Download({
             method: 'POST',
@@ -562,11 +569,12 @@ Roo.extend(Pman.Gnumeric, Roo.util.Observable, {
             url : ((this.downloadUrl || (baseURL + '/GnumericToExcel/')) + name + '.xls',
             success : function() {
                 Roo.MessageBox("Alert", "File should have downloaded now");
+                if (callback) {
+                    callback();
+                }
             }
         });
-        
-        
-        
+         
     }
 
 });
\ No newline at end of file