DataObjects/Builder.php
[Pman.Builder] / old / Pman.Dialog.BuilderViewCode.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by Builder Module - do not edit directly
4 Pman.Dialog.BuilderViewCode = {
5
6     dialog : false,
7     callback:  false,
8
9     show : function(data, cb)
10     {
11         if (!this.dialog) {
12             this.create();
13         }
14
15         this.callback = cb;
16         this.data = data;
17         this.dialog.show();
18         if (this.form) {
19            this.form.reset();
20            this.form.setValues(data);
21         }
22
23     },
24
25     create : function()
26     {
27         var _this = this;
28         this.dialog = Roo.factory({
29             xtype : 'LayoutDialog',
30             xns: Roo,
31             background : true,
32             width : 400,
33             height : 400,
34             title : "View Generated Code",
35             modal : true,
36             resizable : false,
37             collapsible : false,
38             closable : false,
39             listeners : {
40                 show: function (_self)
41                 {
42                     if (_this.isBuilder) {
43                        return;
44                     }
45                     _this.dialog = _self;        
46                     _this.dialog.getLayout().beginUpdate();
47                              
48                             _this.dialog.resizeTo( Roo.lib.Dom.getViewWidth() - 70, Roo.lib.Dom.getViewHeight() - 70);
49                             _this.dialog.getLayout().getRegion('center').resizeTo(Roo.lib.Dom.getViewWidth() - ( 70 + 50 ));
50                          
51                             
52                             _this.dialog.moveTo(35,35);
53                             
54                             _this.dialog.getLayout().endUpdate();
55                             
56                             _this.previewContentPanel.load({
57                                 url: baseURL + '/Builder/Code.php',
58                                 method: 'GET',
59                                 params: {
60                                     id: _this.data.id
61                                     
62                                 }
63                             });
64                             
65                 }
66             },
67             items : [
68                 {
69                     xtype : 'ContentPanel',
70                     background : false,
71                     fitToFrame : true,
72                     region : 'center',
73                     listeners : {
74                         activate: function (_self)
75                         {
76                         _this.previewContentPanel = _self;
77                         }
78                     },
79                     autoScroll : true
80                 }
81             ],
82             center : {
83                 titlebar : false
84             },
85             buttons : [
86                 {
87                     text : "OK",
88                     xtype : 'Button',
89                     xns: Roo,
90                     listeners : {
91                         click: function() {
92                             _this.dialog.hide();
93                         
94                         }
95                     }
96                 }
97             ]
98         });
99     }
100 };