Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleBankAccnt.js
index 83a5149..8926c0a 100644 (file)
 
 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
 
+Roo.namespace('Pman.Dialog');
+
 Pman.Dialog.XtupleBankAccnt = {
 
-    dialog : false,
-    callback:  false,
+ dialog : false,
+ callback:  false,
+
+ show : function(data, cb)
+ {
+  if (!this.dialog) {
+   this.create();
+  }
 
-    show : function(data, cb)
-    {
-        if (!this.dialog) {
-            this.create();
-        }
+  this.callback = cb;
+  this.data = data;
+  this.dialog.show(this.data._el);
+  if (this.form) {
+   this.form.reset();
+   this.form.setValues(data);
+   this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
+  }
 
-        this.callback = cb;
-        this.data = data;
-        this.dialog.show(this.data._el);
-        if (this.form) {
-           this.form.reset();
-           this.form.setValues(data);
-           this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
-        }
+ },
 
+ create : function()
+ {
+   var _this = this;
+   this.dialog = Roo.factory({
+    center : {
+     '|xns' : 'Roo',
+     xtype : 'LayoutRegion',
+     xns : Roo
     },
+    '|xns' : 'Roo',
+    modal : true,
+    collapsible : false,
+    title : "Edit Bank Account",
+    xtype : 'LayoutDialog',
+    width : 400,
+    xns : Roo,
+    closable : false,
+    resizable : false,
+    height : 300,
+    buttons : [
+      {
+       '|xns' : 'Roo',
+       text : "Cancel",
+       xtype : 'Button',
+       xns : Roo,
+       listeners : {
+        click : function (_self, e)
+         {
+             _this.dialog.hide();
+         }
+       }
+      },
+{
+       '|xns' : 'Roo',
+       text : "Save",
+       xtype : 'Button',
+       xns : Roo,
+       listeners : {
+        click : function (_self, e)
+         {
+            
+             _this.form.doAction("submit");
+         
+         }
+       }
+      }
+    ],
+    items : [
+     {
+      '|xns' : 'Roo',
+      region : 'center',
+      xtype : 'ContentPanel',
+      xns : Roo,
+      items : [
+       {
+        '|xns' : 'Roo.form',
+        url : baseURL + '/Roo/Bankaccnt.php',
+        xtype : 'Form',
+        method : 'POST',
+        style : 'margin:10px;',
+        xns : Roo.form,
+        listeners : {
+         actioncomplete : function(_self,action)
+          {
+              if (action.type == 'setdata') {
+              
+                  if(_this.data.id){
+                      _this.dialog.el.mask("Loading");
+                      this.load({ method: 'GET', params: { '_id' : _this.data.id }}); 
+                      
+                  }
+          
+                 return;
+              }
+              if (action.type == 'load') {
+                  _this.dialog.el.unmask();
+                  return;
+              }
+              if (action.type =='submit') {
+              
+                  _this.dialog.el.unmask();
+                  _this.dialog.hide();
+              
+                   if (_this.callback) {
+                      _this.callback.call(_this, _this.form.getValues());
+                   }
+                   _this.form.reset();
+                   return;
+              }
+          },
+         rendered : function (form)
+          {
+              _this.form= form;
+          }
+        },
+        items : [
+         {
+          '|xns' : 'Roo.form',
+          fieldLabel : 'Bank',
+          emptyText : "eg. HSBC",
+          xtype : 'TextField',
+          allowBlank : false,
+          readOnly : true,
+          width : 200,
+          xns : Roo.form,
+          name : 'bankaccnt_bankname'
+         },
+         {
+          '|xns' : 'Roo.form',
+          fieldLabel : 'Name',
+          xtype : 'TextField',
+          emptyText : "Automatic",
+          allowBlank : true,
+          readOnly : true,
+          width : 200,
+          xns : Roo.form,
+          name : 'bankaccnt_name'
+         },
+         {
+          '|xns' : 'Roo.form',
+          fieldLabel : 'Account No.',
+          emptyText : "eg. 1-23-23-23",
+          xtype : 'TextField',
+          allowBlank : false,
+          readOnly : true,
+          width : 200,
+          xns : Roo.form,
+          name : 'bankaccnt_accntnumber'
+         },
+         {
+          '|xns' : 'Roo.form',
+          fieldLabel : 'Description',
+          xtype : 'TextField',
+          allowBlank : false,
+          width : 200,
+          xns : Roo.form,
+          name : 'bankaccnt_descrip'
+         },
+         {
+          '|xns' : 'Roo.form',
+          xtype : 'Hidden',
+          xns : Roo.form,
+          name : 'bankaccnt_id'
+         }
+        ]
+
+       }
+      ]
+
+     }
+    ]
 
-    create : function()
-    {
-        var _this = this;
-        this.dialog = Roo.factory({
-            xtype: 'LayoutDialog',
-            xns: Roo,
-            closable : false,
-            collapsible : false,
-            height : 500,
-            modal : true,
-            resizable : false,
-            title : "Edit Bank Account",
-            width : 600,
-            items : [
-                {
-                    xtype: 'ContentPanel',
-                    xns: Roo,
-                    region : 'center',
-                    items : [
-                        {
-                            xtype: 'Form',
-                            xns: Roo.form,
-                            listeners : {
-                                actioncomplete : function(_self,action)
-                                {
-                                    if (action.type == 'setdata') {
-                                       //_this.dialog.el.mask("Loading");
-                                       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});
-                                       return;
-                                    }
-                                    if (action.type == 'load') {
-                                        _this.dialog.el.unmask();
-                                        return;
-                                    }
-                                    if (action.type =='submit') {
-                                    
-                                        _this.dialog.el.unmask();
-                                        _this.dialog.hide();
-                                    
-                                         if (_this.callback) {
-                                            _this.callback.call(_this, _this.form.getValues());
-                                         }
-                                         _this.form.reset();
-                                         return;
-                                    }
-                                },
-                                rendered : function (form)
-                                {
-                                    _this.form= form;
-                                }
-                            },
-                            method : 'POST',
-                            style : 'margin:10px;',
-                            url : baseURL + '/Roo/Groups.php',
-                            items : [
-                                {
-                                    xtype: 'TextField',
-                                    xns: Roo.form,
-                                    fieldLabel : 'Name',
-                                    name : 'name',
-                                    width : 200
-                                },
-                                {
-                                    xtype: 'TextField',
-                                    xns: Roo.form,
-                                    fieldLabel : 'Type',
-                                    name : 'type',
-                                    width : 75
-                                },
-                                {
-                                    xtype: 'ComboBox',
-                                    xns: Roo.form,
-                                    allowBlank : false,
-                                    editable : false,
-                                    emptyText : "Select Person",
-                                    forceSelection : true,
-                                    listWidth : 400,
-                                    loadingText : "Searching...",
-                                    minChars : 2,
-                                    pageSize : 20,
-                                    qtip : "Select Person",
-                                    selectOnFocus : true,
-                                    triggerAction : 'all',
-                                    typeAhead : true,
-                                    width : 300,
-                                    tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>',
-                                    queryParam : 'query[name]',
-                                    fieldLabel : 'Leader',
-                                    valueField : 'id',
-                                    displayField : 'name',
-                                    hiddenName : 'leader',
-                                    name : 'leader_name',
-                                    store : {
-                                        xtype: 'Store',
-                                        xns: Roo.data,
-                                        remoteSort : true,
-                                        sortInfo : { direction : 'ASC', field: 'id' },
-                                        listeners : {
-                                            beforeload : function (_self, o){
-                                                o.params = o.params || {};
-                                                // set more here
-                                            }
-                                        },
-                                        proxy : {
-                                            xtype: 'HttpProxy',
-                                            xns: Roo.data,
-                                            method : 'GET',
-                                            url : baseURL + '/Roo/Person.php'
-                                        },
-                                        reader : {
-                                            xtype: 'JsonReader',
-                                            xns: Roo.data,
-                                            id : 'id',
-                                            root : 'data',
-                                            totalProperty : 'total',
-                                            fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}]
-                                        }
-                                    }
-                                },
-                                {
-                                    xtype: 'Hidden',
-                                    xns: Roo.form,
-                                    name : 'id'
-                                }
-                            ]
-                        }
-                    ]
-                }
-            ],
-            center : {
-                xtype: 'LayoutRegion',
-                xns: Roo
-            },
-            buttons : [
-                {
-                    xtype: 'Button',
-                    xns: Roo,
-                    listeners : {
-                        click : function (_self, e)
-                        {
-                            _this.dialog.hide();
-                        }
-                    },
-                    text : "Cancel"
-                },
-                {
-                    xtype: 'Button',
-                    xns: Roo,
-                    listeners : {
-                        click : function (_self, e)
-                        {
-                            // do some checks?
-                             
-                            
-                            _this.dialog.el.mask("Saving");
-                            _this.form.doAction("submit");
-                        
-                        }
-                    },
-                    text : "Save"
-                }
-            ]
-        });
-    }
+   });
+ }
 };