Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleGLAccountNameEdit.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.XtupleGLAccountNameEdit = {
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 : false,
34             collapsible : false,
35             height : 180,
36             modal : true,
37             resizable : false,
38             title : "Edit Account Name",
39             width : 450,
40             items : [
41                 {
42                     xtype: 'ContentPanel',
43                     xns: Roo,
44                     region : 'center',
45                     items : [
46                         {
47                             xtype: 'Form',
48                             xns: Roo.form,
49                             listeners : {
50                                 actioncomplete : function(_self,action)
51                                 {
52                                     if (action.type == 'setdata') {
53                                         if(_this.data.accnt_id * 1 >1){
54                                            _this.dialog.el.mask("Loading");
55                                            this.load({ method: 'GET', params: { '_id' : _this.data.accnt_id }});
56                                        }
57                                        return;
58                                     }
59                                     if (action.type == 'load') {
60                                         _this.dialog.el.unmask();
61                                         return;
62                                     }
63                                     if (action.type =='submit') {
64                                     
65                                         _this.dialog.el.unmask();
66                                         _this.dialog.hide();
67                                     
68                                          if (_this.callback) {
69                                             _this.callback.call(_this, _this.form.getValues());
70                                          }
71                                          _this.form.reset();
72                                          return;
73                                     }
74                                 },
75                                 rendered : function (form)
76                                 {
77                                     _this.form= form;
78                                 }
79                             },
80                             labelWidth : 150,
81                             method : 'POST',
82                             style : 'margin:10px;',
83                             url : baseURL + '/Roo/Accnt.php',
84                             items : [
85                                 {
86                                     xtype: 'TextField',
87                                     xns: Roo.form,
88                                     allowBlank : false,
89                                     fieldLabel : 'Account Name',
90                                     name : 'accnt_descrip',
91                                     width : 200
92                                 },
93                                 {
94                                     xtype: 'TextField',
95                                     xns: Roo.form,
96                                     allowBlank : true,
97                                     fieldLabel : 'Alternative Code',
98                                     name : 'accnt_code_alt',
99                                     width : 200
100                                 },
101                                 {
102                                     xtype: 'TextField',
103                                     xns: Roo.form,
104                                     allowBlank : true,
105                                     fieldLabel : 'Alternative Description',
106                                     name : 'accnt_descrip_alt',
107                                     width : 200
108                                 },
109                                 {
110                                     xtype: 'Hidden',
111                                     xns: Roo.form,
112                                     name : 'accnt_id'
113                                 }
114                             ]
115                         }
116                     ]
117                 }
118             ],
119             center : {
120                 xtype: 'LayoutRegion',
121                 xns: Roo
122             },
123             buttons : [
124                 {
125                     xtype: 'Button',
126                     xns: Roo,
127                     listeners : {
128                         click : function (_self, e)
129                         {
130                             _this.dialog.hide();
131                         }
132                     },
133                     text : "Cancel"
134                 },
135                 {
136                     xtype: 'Button',
137                     xns: Roo,
138                     listeners : {
139                         click : function (_self, e)
140                         {
141                             
142                             _this.form.doAction("submit");
143                         
144                         }
145                     },
146                     text : "Save"
147                 }
148             ]
149         });
150     }
151 };