Pman.Dialog.XtupleCustomer.bjs
authorEdward <edward@roojs.com>
Fri, 13 Dec 2013 05:44:24 +0000 (13:44 +0800)
committerEdward <edward@roojs.com>
Fri, 13 Dec 2013 05:44:24 +0000 (13:44 +0800)
Pman.Dialog.XtupleCustomer.js

Pman.Dialog.XtupleCustomer.bjs
Pman.Dialog.XtupleCustomer.js

index 24c0e02..50bed53 100644 (file)
                                                     "|xns": "Roo.form",
                                                     "items": [
                                                         {
-                                                            "fieldLabel": "Customer #",
-                                                            "name": "cust_number",
-                                                            "readOnly": true,
-                                                            "width": 150,
+                                                            "listeners": {
+                                                                "keyup": "function (_self, e)\n{\n    if (!(_this.form.findField('cust_id').getValue() * 1)) {\n    \n        _this.form.findField('cust_number').setValue(this.getValue().replace(/[^a-z0-9]/ig, '').toUpperCase());\n    \n    }\n}"
+                                                            },
+                                                            "fieldLabel": "Name",
+                                                            "name": "cust_name",
+                                                            "width": 300,
                                                             "xtype": "TextField",
                                                             "|xns": "Roo.form"
                                                         },
index ef87046..7a12991 100644 (file)
@@ -125,10 +125,19 @@ Pman.Dialog.XtupleCustomer = {
                                                     {
                                                         xtype: 'TextField',
                                                         xns: Roo.form,
-                                                        fieldLabel : 'Customer #',
-                                                        name : 'cust_number',
-                                                        readOnly : true,
-                                                        width : 150
+                                                        listeners : {
+                                                            keyup : function (_self, e)
+                                                            {
+                                                                if (!(_this.form.findField('cust_id').getValue() * 1)) {
+                                                                
+                                                                    _this.form.findField('cust_number').setValue(this.getValue().replace(/[^a-z0-9]/ig, '').toUpperCase());
+                                                                
+                                                                }
+                                                            }
+                                                        },
+                                                        fieldLabel : 'Name',
+                                                        name : 'cust_name',
+                                                        width : 300
                                                     },
                                                     {
                                                         xtype: 'TextField',