Pman.Download.js
authorAlan Knowles <alan@roojs.com>
Fri, 15 Jun 2012 03:22:06 +0000 (11:22 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 15 Jun 2012 03:22:06 +0000 (11:22 +0800)
Pman.Download.js

index 160c71e..99740de 100644 (file)
@@ -39,6 +39,15 @@ Pman.Download = function(cfg)
     }
     Roo.apply(this, cfg);
     
+    
+    if (this.grid) {
+        
+        this.buildFromGrid();
+        
+    }
+    
+    
+    
     var submit = false;
     this.createCsvFrame();
     
@@ -199,7 +208,32 @@ Roo.apply(Pman.Download.prototype, {
             this.csvFrame= false;
         }
          
+    },
+    
+    buildFromGrid : function()
+    {
+        // get the params from beforeLoad
+        this.grid.ds.fireEvent('beforeload', {
+            params : this.params
+            
+        });
+        
+        // work out the cols
+        Roo.each(this.grid.cm.config, function(c,i) {
+            params['csvCols['+i+']'] = c.dataIndex;
+            params['csvTitles['+i+']'] = c.header;
+            
+        });
+        
+        
+        
+        
     }
+    
+    
+    
+    
+    
      
      
 });
\ No newline at end of file