DataObjects/Core_notify.php
[Pman.Core] / Pman.Download.js
index d135280..c3ef15a 100644 (file)
@@ -40,15 +40,14 @@ Pman.Download = function(cfg)
     this.createCsvFrame();
     
     var requested = 0;
+     
+    Roo.EventManager.on( this.csvFrame, 'load', this.onLoad, this);
     
-   
-    
-    
-    Roo.EventManager.on( this.csvFrame, 'load', cb, this);
     
+    //--- simple method..
     cfg.method = cfg.method || 'GET';
     
-    if (cfg.method == 'GET') {
+    if (cfg.method == 'GET' && !cfg.params) {
         (function() {
             submit = true;
             this.csvFrame.src = cfg.url;
@@ -64,7 +63,7 @@ Pman.Download = function(cfg)
     var b = Roo.get(document.body);
     this.form = b.createChild({
         tag: 'form',
-        method : 'POST',
+        method : cfg.method,
         action : cfg.url,
         target : this.csvFrame.id,
         enctype : 'multipart/form-data'
@@ -172,14 +171,14 @@ Roo.apply(Pman.Download.prototype, {
         
         // this will never fire.. see 
         // http://www.atalasoft.com/cs/blogs/jake/archive/2009/08/18/events-to-expect-when-dynamically-loading-iframes-in-javascript-take-2-thanks-firefox-3-5.aspx
-        if (cfg.success && success) {
+        if (this.success && success) {
             
-            cfg.success();
+            this.success();
         }
        
         
 
-    }
+    },
     
     // private - clean up download elements.
     cleanup :function()