Pman.Dialog.BuilderViewCode.bjs
[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.setContent(
51                         '<PRE>' + Roo.util.Format.htmlEncode(_this.data.jsource) + '</PRE>'
52                     );
53                         
54                     
55                       
56                     _this.jsonContentPanel.setContent(
57                         '<PRE>' + Roo.util.Format.htmlEncode(_this.data.json) + '</PRE>'
58                     );
59                        
60                             
61                 }
62             },
63             background : true,
64             closable : false,
65             collapsible : false,
66             height : 400,
67             modal : true,
68             resizable : true,
69             title : "View Generated Code",
70             width : 400,
71             items : [
72                 {
73                     xtype: 'ContentPanel',
74                     xns: Roo,
75                     listeners : {
76                         activate : function (_self)
77                         {
78                         _this.previewContentPanel = _self;
79                         }
80                     },
81                     autoScroll : true,
82                     background : false,
83                     fitToFrame : true,
84                     region : 'center',
85                     title : "Javascript"
86                 },
87                 {
88                     xtype: 'ContentPanel',
89                     xns: Roo,
90                     listeners : {
91                         activate : function (_self)
92                         {
93                         _this.jsonContentPanel = _self;
94                         }
95                     },
96                     autoScroll : true,
97                     background : true,
98                     fitToFrame : true,
99                     region : 'center',
100                     title : "JSON"
101                 }
102             ],
103             center : {
104                 xtype: 'LayoutRegion',
105                 xns: Roo,
106                 tabPosition : 'top',
107                 titlebar : false
108             },
109             buttons : [
110                 {
111                     xtype: 'Button',
112                     xns: Roo,
113                     text : "OK",
114                     listeners : {
115                         click : function() {
116                             _this.dialog.hide();
117                         
118                         }
119                     }
120                 }
121             ]
122         });
123     }
124 };