DataObjects/Core_domain.php
[Pman.Core] / Pman.Dialog.CoreEmailPreview.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Pman.Dialog.CoreEmailPreview = {
6
7     dialog : false,
8     callback:  false,
9
10     show : function(data, cb)
11     {
12         if (!this.dialog) {
13             this.create();
14         }
15
16         this.callback = cb;
17         this.data = data;
18         this.dialog.show(this.data._el);
19         if (this.form) {
20            this.form.reset();
21            this.form.setValues(data);
22            this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
23         }
24
25     },
26
27     create : function()
28     {
29         var _this = this;
30         this.dialog = Roo.factory({
31             xtype: 'LayoutDialog',
32             xns: Roo,
33             listeners : {
34                 show : function (_self)
35                 {
36                     
37                     _self.layout.getRegion('center').showPanel(0);
38                     _this.panel.load({ 
39                         url: baseURL + '/Core/MessagePreview', 
40                         params  : {
41                             _id : _this.data.id,
42                             _table : _this.data.module
43                         },
44                         method : 'GET'
45                     });
46                     _this.hpanel.load({ 
47                         url: baseURL + '/Core/MessagePreview', 
48                         params  : {
49                             _as_html : 1,
50                             _id : _this.data.id,
51                             _table : _this.data.module
52                         },
53                         method : 'GET'
54                     });
55                         
56                 }
57             },
58             autoScroll : true,
59             closable : true,
60             height : 800,
61             shadow : 'true',
62             title : "Email Preview",
63             width : 1200,
64             items : [
65                 {
66                     xtype: 'ContentPanel',
67                     xns: Roo,
68                     listeners : {
69                         render : function (_self)
70                         {
71                             _this.panel = _self;
72                         }
73                     },
74                     fitContainer : true,
75                     fitToFrame : true,
76                     region : 'center',
77                     title : "Plain"
78                 },
79                 {
80                     xtype: 'ContentPanel',
81                     xns: Roo,
82                     listeners : {
83                         render : function (_self)
84                         {
85                             _this.hpanel = _self;
86                         }
87                     },
88                     fitContainer : true,
89                     fitToFrame : true,
90                     region : 'center',
91                     title : "HTML"
92                 }
93             ],
94             center : {
95                 xtype: 'LayoutRegion',
96                 xns: Roo,
97                 autoScroll : true,
98                 tabPosition : 'top'
99             },
100             buttons : [
101                 {
102                     xtype: 'Button',
103                     xns: Roo,
104                     listeners : {
105                         click : function (_self, e)
106                         {
107                             _this.dialog.hide();
108                         }
109                     },
110                     text : "OK"
111                 }
112             ]
113         });
114     }
115 };