Pman.Tab.BuilderProps.js
[Pman.Builder] / Pman.Dialog.BuilderViewCode.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.BuilderViewCode = {
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                     if (_this.isBuilder) {
37                        return;
38                     }
39                     _this.dialog = _self;        
40                     _this.dialog.getLayout().beginUpdate();
41                              
42                             _this.dialog.resizeTo( Roo.lib.Dom.getViewWidth() - 70, Roo.lib.Dom.getViewHeight() - 70);
43                             _this.dialog.getLayout().getRegion('center').resizeTo(Roo.lib.Dom.getViewWidth() - ( 70 + 50 ));
44                          
45                             
46                             _this.dialog.moveTo(35,35);
47                             
48                             _this.dialog.getLayout().endUpdate();
49                             
50                             _this.previewContentPanel.load({
51                                 url: baseURL + '/Builder/Code.php',
52                                 method: 'GET',
53                                 params: {
54                                     id: _this.data.id
55                                     
56                                 }
57                             });
58                             
59                 }
60             },
61             background : true,
62             closable : false,
63             collapsible : false,
64             height : 400,
65             modal : true,
66             resizable : false,
67             title : "View Generated Code",
68             width : 400,
69             items : [
70                 {
71                     xtype: 'ContentPanel',
72                     xns: Roo,
73                     background : false,
74                     fitToFrame : true,
75                     region : 'center',
76                     listeners : {
77                         activate : function (_self)
78                         {
79                         _this.previewContentPanel = _self;
80                         }
81                     },
82                     autoScroll : true
83                 }
84             ],
85             center : {
86                 xtype: 'LayoutRegion',
87                 xns: Roo,
88                 titlebar : false
89             },
90             buttons : [
91                 {
92                     xtype: 'Button',
93                     xns: Roo,
94                     text : "OK",
95                     listeners : {
96                         click : function() {
97                             _this.dialog.hide();
98                         
99                         }
100                     }
101                 }
102             ]
103         });
104     }
105 };