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             width : 800,
36             items : [
37                 {
38                     xtype: 'GridPanel',
39                     xns: Roo,
40                     region : 'center',
41                     grid : {
42                         xtype: 'EditorGrid',
43                         xns: Roo.grid,
44                         ds : {
45                             xtype: 'Store',
46                             xns: Roo.data
47                         },
48                         cm : [
49                             {
50                                 xtype: 'ColumnModel',
51                                 xns: Roo.grid,
52                                 header : 'Label'
53                             }
54                         ]
55                     }
56                 }
57             ],
58             center : {
59                 xtype: 'LayoutRegion',
60                 xns: Roo
61             },
62             buttons : [
63                 {
64                     xtype: 'Button',
65                     xns: Roo,
66                     text : "Cancel"
67                 },
68                 {
69                     xtype: 'Button',
70                     xns: Roo,
71                     text : "Save"
72                 }
73             ]
74         });
75     }
76 };