DataObjects/Period.php
[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 : 150,
36             modal : true,
37             resizable : false,
38             title : "Edit Bank Account",
39             width : 400,
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 : true,
91                                     emptyText : "Automatic",
92                                     fieldLabel : 'Name',
93                                     name : 'bankaccnt_name',
94                                     readOnly : true,
95                                     width : 200
96                                 },
97                                 {
98                                     xtype: 'TextField',
99                                     xns: Roo.form,
100                                     allowBlank : false,
101                                     fieldLabel : 'Description',
102                                     name : 'bankaccnt_descrip',
103                                     width : 200
104                                 },
105                                 {
106                                     xtype: 'Hidden',
107                                     xns: Roo.form,
108                                     name : 'bankaccnt_id'
109                                 }
110                             ]
111                         }
112                     ]
113                 }
114             ],
115             center : {
116                 xtype: 'LayoutRegion',
117                 xns: Roo
118             },
119             buttons : [
120                 {
121                     xtype: 'Button',
122                     xns: Roo,
123                     listeners : {
124                         click : function (_self, e)
125                         {
126                             _this.dialog.hide();
127                         }
128                     },
129                     text : "Cancel"
130                 },
131                 {
132                     xtype: 'Button',
133                     xns: Roo,
134                     listeners : {
135                         click : function (_self, e)
136                         {
137                            
138                             _this.form.doAction("submit");
139                         
140                         }
141                     },
142                     text : "Save"
143                 }
144             ]
145         });
146     }
147 };