Pman.Download.js
[Pman.Core] / Pman.Download.js
index 551bd5a..7680915 100644 (file)
@@ -125,10 +125,12 @@ Roo.apply(Pman.Download.prototype, {
     
     limit : 9999,
     
+    
+    method : 'GET',
+    
     // private..
     createCsvFrame: function()
     {
-        
         if (this.csvFrame) {
             document.body.removeChild(this.csvFrame);
         }
@@ -222,10 +224,24 @@ Roo.apply(Pman.Download.prototype, {
     buildFromGrid : function()
     {
         // get the params from beforeLoad
-        this.grid.ds.fireEvent('beforeload', this.grid.ds, {
+        var ds = this.grid.ds;
+        ds.fireEvent('beforeload', ds, {
             params : this.params
             
         });
+        
+         if(ds.sortInfo && ds.remoteSort){
+            var pn = ds.paramNames;
+            this.params[pn["sort"]] = ds.sortInfo.field;
+            this.params[pn["dir"]] = ds.sortInfo.direction;
+        }
+        if (ds.multiSort) {
+            var pn = ds.paramNames;
+            this.params[pn["multisort"]] = Roo.encode( { sort : ds.sortToggle, order: ds.sortOrder });
+        }
+        
+        
+        
         this.url = this.grid.ds.proxy.conn.url;
         this.method = this.grid.ds.proxy.conn.method ;
         var t = this;
@@ -235,11 +251,15 @@ Roo.apply(Pman.Download.prototype, {
             t.params['csvTitles['+i+']'] = c.header;
             
         });
+        
         if (this.grid.loadMask) {
             this.grid.loadMask.onLoad();
         }
         this.params.limit = this.limit;
         
+        // do it as a post, as args can get long..
+        this.params._get = 1;
+        this.method = 'POST';
         
     }