Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleBankAccnt.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.XtupleBankAccnt = {
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      '|xns' : 'Roo',
35      xtype : 'LayoutRegion',
36      xns : Roo
37     },
38     '|xns' : 'Roo',
39     modal : true,
40     collapsible : false,
41     title : "Edit Bank Account",
42     xtype : 'LayoutDialog',
43     width : 400,
44     xns : Roo,
45     closable : false,
46     resizable : false,
47     height : 300,
48     buttons : [
49       {
50        '|xns' : 'Roo',
51        text : "Cancel",
52        xtype : 'Button',
53        xns : Roo,
54        listeners : {
55         click : function (_self, e)
56          {
57              _this.dialog.hide();
58          }
59        }
60       },
61 {
62        '|xns' : 'Roo',
63        text : "Save",
64        xtype : 'Button',
65        xns : Roo,
66        listeners : {
67         click : function (_self, e)
68          {
69             
70              _this.form.doAction("submit");
71          
72          }
73        }
74       }
75     ],
76     items : [
77      {
78       '|xns' : 'Roo',
79       region : 'center',
80       xtype : 'ContentPanel',
81       xns : Roo,
82       items : [
83        {
84         '|xns' : 'Roo.form',
85         url : baseURL + '/Roo/Bankaccnt.php',
86         xtype : 'Form',
87         method : 'POST',
88         style : 'margin:10px;',
89         xns : Roo.form,
90         listeners : {
91          actioncomplete : function(_self,action)
92           {
93               if (action.type == 'setdata') {
94               
95                   if(_this.data.id){
96                       _this.dialog.el.mask("Loading");
97                       this.load({ method: 'GET', params: { '_id' : _this.data.id }}); 
98                       
99                   }
100           
101                  return;
102               }
103               if (action.type == 'load') {
104                   _this.dialog.el.unmask();
105                   return;
106               }
107               if (action.type =='submit') {
108               
109                   _this.dialog.el.unmask();
110                   _this.dialog.hide();
111               
112                    if (_this.callback) {
113                       _this.callback.call(_this, _this.form.getValues());
114                    }
115                    _this.form.reset();
116                    return;
117               }
118           },
119          rendered : function (form)
120           {
121               _this.form= form;
122           }
123         },
124         items : [
125          {
126           '|xns' : 'Roo.form',
127           fieldLabel : 'Bank',
128           emptyText : "eg. HSBC",
129           xtype : 'TextField',
130           allowBlank : false,
131           readOnly : true,
132           width : 200,
133           xns : Roo.form,
134           name : 'bankaccnt_bankname'
135          },
136          {
137           '|xns' : 'Roo.form',
138           fieldLabel : 'Name',
139           xtype : 'TextField',
140           emptyText : "Automatic",
141           allowBlank : true,
142           readOnly : true,
143           width : 200,
144           xns : Roo.form,
145           name : 'bankaccnt_name'
146          },
147          {
148           '|xns' : 'Roo.form',
149           fieldLabel : 'Account No.',
150           emptyText : "eg. 1-23-23-23",
151           xtype : 'TextField',
152           allowBlank : false,
153           readOnly : true,
154           width : 200,
155           xns : Roo.form,
156           name : 'bankaccnt_accntnumber'
157          },
158          {
159           '|xns' : 'Roo.form',
160           fieldLabel : 'Description',
161           xtype : 'TextField',
162           allowBlank : false,
163           width : 200,
164           xns : Roo.form,
165           name : 'bankaccnt_descrip'
166          },
167          {
168           '|xns' : 'Roo.form',
169           xtype : 'Hidden',
170           xns : Roo.form,
171           name : 'bankaccnt_id'
172          }
173         ]
174
175        }
176       ]
177
178      }
179     ]
180
181    });
182  }
183 };