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                     }
45                 }
46             ],
47             center : {
48                 xtype: 'LayoutRegion',
49                 xns: Roo
50             },
51             buttons : [
52                 {
53                     xtype: 'Button',
54                     xns: Roo,
55                     text : "Cancel"
56                 },
57                 {
58                     xtype: 'Button',
59                     xns: Roo,
60                     text : "Save"
61                 }
62             ]
63         });
64     }
65 };