Pman.Dialog.BuilderForm.bjs
[Pman.Builder] / Pman.Dialog.BuilderForm.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.BuilderForm = {
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             closable : true,
34             height : 600,
35             title : "Edit Form Elements",
36             width : 800,
37             items : [
38                 {
39                     xtype: 'GridPanel',
40                     xns: Roo,
41                     region : 'center',
42                     grid : {
43                         xtype: 'EditorGrid',
44                         xns: Roo.grid,
45                         ds : {
46                             xtype: 'Store',
47                             xns: Roo.data
48                         },
49                         cm : [
50                             {
51                                 xtype: 'ColumnModel',
52                                 xns: Roo.grid,
53                                 header : 'Label'
54                             },
55                             {
56                                 xtype: 'ColumnModel',
57                                 xns: Roo.grid,
58                                 header : 'Display Field'
59                             },
60                             {
61                                 xtype: 'ColumnModel',
62                                 xns: Roo.grid,
63                                 header : 'Display Field'
64                             },
65                             {
66                                 xtype: 'ColumnModel',
67                                 xns: Roo.grid,
68                                 header : 'Source Data'
69                             },
70                             {
71                                 xtype: 'ColumnModel',
72                                 xns: Roo.grid,
73                                 header : 'Type'
74                             }
75                         ]
76                     }
77                 }
78             ],
79             center : {
80                 xtype: 'LayoutRegion',
81                 xns: Roo
82             },
83             buttons : [
84                 {
85                     xtype: 'Button',
86                     xns: Roo,
87                     text : "Cancel"
88                 },
89                 {
90                     xtype: 'Button',
91                     xns: Roo,
92                     text : "Save"
93                 }
94             ]
95         });
96     }
97 };