Pman.Dialog.XtupleBankAccnt.bjs
[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 Pman.Dialog.XtupleBankAccnt = {
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 : 500,
36             modal : true,
37             resizable : false,
38             title : "Edit Bank Account",
39             width : 600,
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                                     
54                                         if(_this.data.id){
55                                             _this.dialog.el.mask("Loading");
56                                             this.load({ method: 'GET', params: { '_id' : _this.data.id }}); 
57                                             
58                                         }
59                                 
60                                        return;
61                                     }
62                                     if (action.type == 'load') {
63                                         _this.dialog.el.unmask();
64                                         return;
65                                     }
66                                     if (action.type =='submit') {
67                                     
68                                         _this.dialog.el.unmask();
69                                         _this.dialog.hide();
70                                     
71                                          if (_this.callback) {
72                                             _this.callback.call(_this, _this.form.getValues());
73                                          }
74                                          _this.form.reset();
75                                          return;
76                                     }
77                                 },
78                                 rendered : function (form)
79                                 {
80                                     _this.form= form;
81                                 }
82                             },
83                             method : 'POST',
84                             style : 'margin:10px;',
85                             url : baseURL + '/Roo/Bankaccnt.php',
86                             items : [
87                                 {
88                                     xtype: 'TextField',
89                                     xns: Roo.form,
90                                     allowBlank : false,
91                                     disabled : true,
92                                     fieldLabel : 'Name',
93                                     name : 'bankaccnt_name',
94                                     value : "Automatic",
95                                     width : 200
96                                 },
97                                 {
98                                     xtype: 'TextField',
99                                     xns: Roo.form,
100                                     fieldLabel : 'Type',
101                                     name : 'type',
102                                     width : 75
103                                 },
104                                 {
105                                     xtype: 'Hidden',
106                                     xns: Roo.form,
107                                     name : 'bankaccnt_id'
108                                 }
109                             ]
110                         }
111                     ]
112                 }
113             ],
114             center : {
115                 xtype: 'LayoutRegion',
116                 xns: Roo
117             },
118             buttons : [
119                 {
120                     xtype: 'Button',
121                     xns: Roo,
122                     listeners : {
123                         click : function (_self, e)
124                         {
125                             _this.dialog.hide();
126                         }
127                     },
128                     text : "Cancel"
129                 },
130                 {
131                     xtype: 'Button',
132                     xns: Roo,
133                     listeners : {
134                         click : function (_self, e)
135                         {
136                            
137                             _this.form.doAction("submit");
138                         
139                         }
140                     },
141                     text : "Save"
142                 }
143             ]
144         });
145     }
146 };