[Commits] r1692 - in sandbox/cmoullet/ux/LayerManager/ux: data downloadify/images widgets

commits at geoext.org commits at geoext.org
Sun Jan 10 08:26:01 CET 2010


Author: cmoullet
Date: 2010-01-10 08:26:01 +0100 (Sun, 10 Jan 2010)
New Revision: 1692

Added:
   sandbox/cmoullet/ux/LayerManager/ux/downloadify/images/extjs_download_default.png
Modified:
   sandbox/cmoullet/ux/LayerManager/ux/data/Export.js
   sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportWindow.js
Log:
Add downloadify in an Ext.Window

Modified: sandbox/cmoullet/ux/LayerManager/ux/data/Export.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/data/Export.js	2010-01-09 19:24:05 UTC (rev 1691)
+++ sandbox/cmoullet/ux/LayerManager/ux/data/Export.js	2010-01-10 07:26:01 UTC (rev 1692)
@@ -83,12 +83,12 @@
         filename: 'export.' + GeoExt.ux.data.Export.format.toLowerCase(),
         filecontent: GeoExt.ux.data.Export.content.replace(/&lt;/g, '<').replace(/&gt;/g, '>')
     });
-    //exportWindow.show();
-    if (exportWindowLocation) {
-       GeoExt.ux.data.Export.exportWindow = window.open(exportWindowLocation, "_blank", "menubar=1,scrollbars=1,width=800,height=600");    
-    } else {
-       GeoExt.ux.data.Export.exportWindow = window.open("../ux/data/ExportWindow.html", "_blank", "menubar=1,scrollbars=1,width=800,height=600");
-    }
+    exportWindow.show();
+    //if (exportWindowLocation) {
+    //    GeoExt.ux.data.Export.exportWindow = window.open(exportWindowLocation, "_blank", "menubar=1,scrollbars=1,width=800,height=600");
+    //} else {
+    //    GeoExt.ux.data.Export.exportWindow = window.open("../ux/data/ExportWindow.html", "_blank", "menubar=1,scrollbars=1,width=800,height=600");
+    //}
 
 };
 

Added: sandbox/cmoullet/ux/LayerManager/ux/downloadify/images/extjs_download_default.png
===================================================================
(Binary files differ)


Property changes on: sandbox/cmoullet/ux/LayerManager/ux/downloadify/images/extjs_download_default.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportWindow.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportWindow.js	2010-01-09 19:24:05 UTC (rev 1691)
+++ sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportWindow.js	2010-01-10 07:26:01 UTC (rev 1692)
@@ -21,25 +21,79 @@
     bodyStyle:'padding:5px;',
     filename: null,
     filecontent: null,
+    downloadifyBox: null,
+    downloadifyLoaded: false,
 
     initComponent: function() {
+        this.downloadifyBox = new Ext.BoxComponent({
+            x: 405,
+            y: 6,
+            width: 66,
+            height: 21,
+            id: 'downloadify',
+            anchor:'',
+            autoEl:{
+                tag:'p',
+                style:"text-align:right"
+            }
+        });
+
+
         this.items = [
             {
                 x: 10,
                 y: 5,
                 xtype: 'textfield',
+                id: 'filename',
                 name: 'filename',
                 value: this.filename,
-                anchor: '100%'
+                width: 384
             },
+            this.downloadifyBox,
             {
                 x: 10,
                 y: 35,
                 xtype: 'textarea',
+                id: 'data',
+                name: 'data',
                 value: this.filecontent,
                 anchor: '100% 100%'  // anchor width and height
             }
         ];
+
         GeoExt.ux.LayerManagerExportWindow.superclass.initComponent.call(this);
+        this.on(
+                'afterlayout', function() {
+            var el = Ext.get('downloadify');
+            if (el && !this.downloadifyLoaded) {
+                //alert('downloadify exists');
+                Downloadify.create('downloadify', {
+                    filename: function() {
+                        return document.getElementById('filename').value;
+                    },
+                    data: function() {
+                        return document.getElementById('data').value;
+                    },
+                    onComplete: function() {
+                        Ext.getCmp('layermanagerexportwindow').close();
+                    },
+                    onCancel: function() {
+                    },
+                    onError: function() {
+                        alert('Error occured during storage');
+                    },
+                    transparent: false,
+                    swf: '../ux/downloadify/media/downloadify.swf',
+                    downloadImage: '../ux/downloadify/images/extjs_download_default.png',
+                    width: 66,
+                    height: 21,
+                    append: false
+                });
+                this.downloadifyLoaded = true;
+            }
+        },
+                this);
+
     }
+
 });
\ No newline at end of file



More information about the Commits mailing list