Pman.Dialog.CoreEmailPreview.bjs
authorEdward <edward@roojs.com>
Fri, 21 Feb 2014 04:26:08 +0000 (12:26 +0800)
committerEdward <edward@roojs.com>
Fri, 21 Feb 2014 04:26:08 +0000 (12:26 +0800)
Pman.Dialog.CoreEmailPreview.js

Pman.Dialog.CoreEmailPreview.bjs
Pman.Dialog.CoreEmailPreview.js

index da3c29b..f1402f6 100644 (file)
@@ -4,7 +4,61 @@
     "parent": "",
     "title": "",
     "path": "/home/edward/gitlive/Pman.Core/Pman.Dialog.CoreEmailPreview.bjs",
-    "items": false,
+    "items": [
+        {
+            "listeners": {
+                "show": "function (_self)\n{\n    var m = 'Core';\n    \n    if(_this.data.module == 'crm'){\n        m = 'Crm';\n    }\n\n    _self.layout.getRegion('center').showPanel(0);\n    _this.panel.load({ \n        url: baseURL + '/' + m + '/MessagePreview', \n        params  : {\n            _id : _this.data.id\n        },\n        method : 'GET'\n    });\n    _this.hpanel.load({ \n        url: baseURL + '/' + m + '/MessagePreview', \n        params  : {\n            _as_html : 1,\n            _id : _this.data.id\n        },\n        method : 'GET'\n    });\n        \n}"
+            },
+            "autoScroll": true,
+            "closable": true,
+            "height": 800,
+            "shadow": "true",
+            "title": "Email Preview",
+            "width": 1200,
+            "xtype": "LayoutDialog",
+            "|xns": "Roo",
+            "items": [
+                {
+                    "*prop": "center",
+                    "autoScroll": true,
+                    "tabPosition": "top",
+                    "xtype": "LayoutRegion",
+                    "|xns": "Roo"
+                },
+                {
+                    "listeners": {
+                        "render": "function (_self)\n{\n    _this.panel = _self;\n}"
+                    },
+                    "fitContainer": true,
+                    "fitToFrame": true,
+                    "region": "center",
+                    "title": "Plain",
+                    "xtype": "ContentPanel",
+                    "|xns": "Roo"
+                },
+                {
+                    "listeners": {
+                        "render": "function (_self)\n{\n    _this.hpanel = _self;\n}"
+                    },
+                    "fitContainer": true,
+                    "fitToFrame": true,
+                    "region": "center",
+                    "title": "HTML",
+                    "xtype": "ContentPanel",
+                    "|xns": "Roo"
+                },
+                {
+                    "listeners": {
+                        "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
+                    },
+                    "*prop": "buttons[]",
+                    "text": "OK",
+                    "xtype": "Button",
+                    "|xns": "Roo"
+                }
+            ]
+        }
+    ],
     "permname": "",
     "modOrder": "001"
 }
\ No newline at end of file
index c227083..8f9f82a 100644 (file)
@@ -1 +1,118 @@
-0
\ No newline at end of file
+//<script type="text/javascript">
+
+// Auto generated file - created by app.Builder.js- do not edit directly (at present!)
+
+Pman.Dialog.CoreEmailPreview = {
+
+    dialog : false,
+    callback:  false,
+
+    show : function(data, cb)
+    {
+        if (!this.dialog) {
+            this.create();
+        }
+
+        this.callback = cb;
+        this.data = data;
+        this.dialog.show(this.data._el);
+        if (this.form) {
+           this.form.reset();
+           this.form.setValues(data);
+           this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
+        }
+
+    },
+
+    create : function()
+    {
+        var _this = this;
+        this.dialog = Roo.factory({
+            xtype: 'LayoutDialog',
+            xns: Roo,
+            listeners : {
+                show : function (_self)
+                {
+                    var m = 'Core';
+                    
+                    if(_this.data.module == 'crm'){
+                        m = 'Crm';
+                    }
+                
+                    _self.layout.getRegion('center').showPanel(0);
+                    _this.panel.load({ 
+                        url: baseURL + '/' + m + '/MessagePreview', 
+                        params  : {
+                            _id : _this.data.id
+                        },
+                        method : 'GET'
+                    });
+                    _this.hpanel.load({ 
+                        url: baseURL + '/' + m + '/MessagePreview', 
+                        params  : {
+                            _as_html : 1,
+                            _id : _this.data.id
+                        },
+                        method : 'GET'
+                    });
+                        
+                }
+            },
+            autoScroll : true,
+            closable : true,
+            height : 800,
+            shadow : 'true',
+            title : "Email Preview",
+            width : 1200,
+            items : [
+                {
+                    xtype: 'ContentPanel',
+                    xns: Roo,
+                    listeners : {
+                        render : function (_self)
+                        {
+                            _this.panel = _self;
+                        }
+                    },
+                    fitContainer : true,
+                    fitToFrame : true,
+                    region : 'center',
+                    title : "Plain"
+                },
+                {
+                    xtype: 'ContentPanel',
+                    xns: Roo,
+                    listeners : {
+                        render : function (_self)
+                        {
+                            _this.hpanel = _self;
+                        }
+                    },
+                    fitContainer : true,
+                    fitToFrame : true,
+                    region : 'center',
+                    title : "HTML"
+                }
+            ],
+            center : {
+                xtype: 'LayoutRegion',
+                xns: Roo,
+                autoScroll : true,
+                tabPosition : 'top'
+            },
+            buttons : [
+                {
+                    xtype: 'Button',
+                    xns: Roo,
+                    listeners : {
+                        click : function (_self, e)
+                        {
+                            _this.dialog.hide();
+                        }
+                    },
+                    text : "OK"
+                }
+            ]
+        });
+    }
+};