Pman.Dialog.AdminEnumType.bjs
[Pman.Admin] / Pman.Dialog.AdminEnumType.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Dialog');
6
7 Pman.Dialog.AdminEnumType = {
8
9     dialog : false,
10     callback:  false,
11
12     show : function(data, cb)
13     {
14         if (!this.dialog) {
15             this.create();
16         }
17
18         this.callback = cb;
19         this.data = data;
20         this.dialog.show(this.data._el);
21         if (this.form) {
22            this.form.reset();
23            this.form.setValues(data);
24            this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
25         }
26
27     },
28
29     create : function()
30     {
31         var _this = this;
32         this.dialog = Roo.factory({
33             center
34  : {
35                 '|xns' : 'Roo',
36                 xtype : 'LayoutRegion',
37                 xns : Roo
38             },
39             '|xns' : 'Roo',
40             modal : true,
41             width : 480,
42             xtype : 'LayoutDialog',
43             height : 160,
44             resizable : false,
45             xns : Roo,
46             title : "Edit",
47             buttons : [
48                  {
49                         '|xns' : 'Roo',
50                         xtype : 'Button',
51                         text : "Save",
52                         xns : Roo,
53                         listeners : {
54                                 click : function (_self, e)
55                                    {
56                                        //this.url = baseURL + '/Roo/Core_enum.php';
57                                        //_this.dialog.el.mask("Saving");
58                                        _this.form.doAction("submit");
59                                    }
60                         }
61                     },
62 {
63                         '|xns' : 'Roo',
64                         xtype : 'Button',
65                         text : "Cancel",
66                         xns : Roo,
67                         listeners : {
68                                 click : function (_self, e)
69                                    {
70                                        _this.dialog.hide();
71                                    }
72                         }
73                     }
74             ],
75             items : [
76                 {
77                     '|xns' : 'Roo',
78                     xtype : 'ContentPanel',
79                     xns : Roo,
80                     region : 'center',
81                     items : [
82                         {
83                             '|xns' : 'Roo.form',
84                             url : baseURL + '/Roo/Core_enum',
85                             xtype : 'Form',
86                             xns : Roo.form,
87                             listeners : {
88                                 actioncomplete : function (_self, action)
89                                    {
90                                        if(action.type == 'submit'){
91                                            _this.dialog.hide();
92                                            
93                                            if(_this.callback){
94                                                _this.callback.call(_this, _this.form.getValues());
95                                            }
96                                            return
97                                        }
98                                    },
99                                 rendered : function (form)
100                                    {
101                                        _this.form = this;
102                                    }
103                             },
104                             items : [
105                                 {
106                                     '|xns' : 'Roo.form',
107                                     name : 'name',
108                                     width : 270,
109                                     xtype : 'TextField',
110                                     fieldLabel : 'Name',
111                                     xns : Roo.form
112                                 },
113                                 {
114                                     '|xns' : 'Roo.form',
115                                     name : 'id',
116                                     xtype : 'Hidden',
117                                     xns : Roo.form
118                                 },
119                                 {
120                                     '|xns' : 'Roo.form',
121                                     name : 'etype',
122                                     xtype : 'Hidden',
123                                     xns : Roo.form
124                                 },
125                                 {
126                                     '|xns' : 'Roo.form',
127                                     name : 'display_name',
128                                     width : 270,
129                                     xtype : 'TextField',
130                                     fieldLabel : 'Display Name',
131                                     xns : Roo.form
132                                 }
133                             ]
134
135                         }
136                     ]
137
138                 }
139             ]
140
141         });
142     }
143 };