Pman.Download.js
[Pman.Core] / Pman.Download.js
index fa5e3b4..560bb54 100644 (file)
@@ -116,10 +116,7 @@ Pman.Download = function(cfg)
         
     }
     
-    
-    
     (function() {
-        alert(this.form.dom);return;
         this.submit = true;
         this.form.dom.submit();
         this.cleanup.defer(this.timeout || 30000,this);
@@ -179,7 +176,7 @@ Roo.apply(Pman.Download.prototype, {
         if (!this.submit) {
             return false;
         }
-        return false;
+        //return false;
       
         var frame = this.csvFrame;
         var success  = true; 
@@ -194,8 +191,10 @@ Roo.apply(Pman.Download.prototype, {
                   
                 Roo.MessageBox.alert("Download Error", doc.body.innerHTML);
                 success  = false;
-                 
-                
+                if (this.failure) {
+                    this.failure();
+                }
+                return;
             }
             
             Roo.log(doc.body.innerHTML);
@@ -205,6 +204,9 @@ Roo.apply(Pman.Download.prototype, {
             Roo.log(e.toString());
             Roo.log(e);
         }
+        if (this.success) {
+            this.success();
+        }
         // we can not actually do anything with the frame... as it may actually still be downloading..
         return true;