Pman.Dialog.CoreCompanies.bjs
authoredward <edward@roojs.com>
Fri, 4 Nov 2016 05:52:11 +0000 (13:52 +0800)
committeredward <edward@roojs.com>
Fri, 4 Nov 2016 05:52:11 +0000 (13:52 +0800)
Pman.Dialog.CoreCompanies.js

Pman.Dialog.CoreCompanies.bjs
Pman.Dialog.CoreCompanies.js

index 76534ab..382d91e 100644 (file)
     },
     {
      "listeners" : {
-      "click" : "function (_self, e)\n{\n    // do some checks?\n    \n    if(!_this.form.isValid()){\n        Roo.MessageBox.alert('Error', 'Please Correct all the errors in red');\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Core_enum.php',\n        method : 'POST',\n        params : {\n          id : record.data.id,\n          etype : _this.data.etype,\n          name :  record.data.name,\n          active : record.data.active,\n          seqid : record.data.seqid,\n          display_name : record.data.display_name\n        }, \n        success : function(res) {\n          //Roo.log(data);\n          // update the ID if it's not set..\n          if (record.data.id * 1 < 1) {\n              record.set('id', res.data.id);\n          }\n        }\n    });\n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
+      "click" : "function (_self, e)\n{\n    if(!_this.form.isValid()){\n        Roo.MessageBox.alert('Error', 'Please Correct all the errors in red');\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Core_enum.php',\n        method : 'POST',\n        params : {\n          id : _this.form.findField('id').getValue() * 1,\n          name : _this.form.findField('name').getValue(),\n          _check_name : 1\n        }, \n        success : function(res) {\n            \n        }\n    });\n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
      },
      "text" : "Save",
      "xtype" : "Button",
index 7368828..8786694 100644 (file)
@@ -100,8 +100,6 @@ Pman.Dialog.CoreCompanies = {
       listeners : {
        click : function (_self, e)
         {
-            // do some checks?
-            
             if(!_this.form.isValid()){
                 Roo.MessageBox.alert('Error', 'Please Correct all the errors in red');
                 return;
@@ -111,19 +109,12 @@ Pman.Dialog.CoreCompanies = {
                 url : baseURL + '/Roo/Core_enum.php',
                 method : 'POST',
                 params : {
-                  id : record.data.id,
-                  etype : _this.data.etype,
-                  name :  record.data.name,
-                  active : record.data.active,
-                  seqid : record.data.seqid,
-                  display_name : record.data.display_name
+                  id : _this.form.findField('id').getValue() * 1,
+                  name : _this.form.findField('name').getValue(),
+                  _check_name : 1
                 }, 
                 success : function(res) {
-                  //Roo.log(data);
-                  // update the ID if it's not set..
-                  if (record.data.id * 1 < 1) {
-                      record.set('id', res.data.id);
-                  }
+                    
                 }
             });