Pman.Dialog.CoreMailingListMessagePreview.bjs
[Pman.Core] / Pman.Dialog.CoreMailingListMessagePreview.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.CoreMailingListMessagePreview = {
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                     Roo.log(_self.data);
37                     var m = 'Core';
38                     
39                     if(_this.data.module = 'crm'){
40                         m = 'Crm';
41                     }
42                 
43                     _self.layout.getRegion('center').showPanel(0);
44                     _this.panel.load({ 
45                         url: baseURL + '/' + m + '/MessagePreview', 
46                         params  : {
47                             _id : _this.data.id
48                         },
49                         method : 'GET'
50                     });
51                     _this.hpanel.load({ 
52                         url: baseURL + '/' + m + '/MessagePreview', 
53                         params  : {
54                             _as_html : 1,
55                             _id : _this.data.id
56                         },
57                         method : 'GET'
58                     });
59                         
60                 }
61             },
62             autoScroll : true,
63             closable : true,
64             height : 800,
65             shadow : 'true',
66             title : "Email Preview",
67             width : 1200,
68             items : [
69                 {
70                     xtype: 'ContentPanel',
71                     xns: Roo,
72                     listeners : {
73                         render : function (_self)
74                         {
75                             _this.panel = _self;
76                         }
77                     },
78                     fitContainer : true,
79                     fitToFrame : true,
80                     region : 'center',
81                     title : "Plain"
82                 },
83                 {
84                     xtype: 'ContentPanel',
85                     xns: Roo,
86                     listeners : {
87                         render : function (_self)
88                         {
89                             _this.hpanel = _self;
90                         }
91                     },
92                     fitContainer : true,
93                     fitToFrame : true,
94                     region : 'center',
95                     title : "HTML"
96                 }
97             ],
98             center : {
99                 xtype: 'LayoutRegion',
100                 xns: Roo,
101                 autoScroll : true,
102                 tabPosition : 'top'
103             },
104             buttons : [
105                 {
106                     xtype: 'Button',
107                     xns: Roo,
108                     listeners : {
109                         click : function (_self, e)
110                         {
111                             _this.dialog.hide();
112                         }
113                     },
114                     text : "OK"
115                 }
116             ]
117         });
118     }
119 };