fix name on enum save
authorAlan <alan@roojs.com>
Wed, 27 Oct 2021 07:42:03 +0000 (15:42 +0800)
committerAlan <alan@roojs.com>
Wed, 27 Oct 2021 07:42:03 +0000 (15:42 +0800)
Pman.Dialog.CoreEnum.bjs
Pman.Dialog.CoreEnum.js

index a13189f..6dd5f21 100644 (file)
@@ -45,9 +45,9 @@
      "* prop" : "center"
     },
     {
+     "region" : "center",
      "fitToFrame" : true,
      "background" : true,
-     "region" : "center",
      "xtype" : "ContentPanel",
      "$ xns" : "Roo",
      "items" : [
@@ -57,8 +57,8 @@
         "|rendered" : "function (form)\n{\n   _this.form = form;\n}"
        },
        "$ url" : "baseURL + '/Roo/core_enum.php'",
-       "method" : "POST",
        "xtype" : "Form",
+       "method" : "POST",
        "style" : "margin: 5px",
        "$ xns" : "Roo.form",
        "items" : [
     },
     {
      "listeners" : {
-      "|click" : "function() {\n\n    var name =     _this.form.findField('name').getValue();\n    name = name.toUpperCase().replace(/[^A-Z]+/g, '');\n    if (!name.length) {\n        Roo.MessageBox.alert(\"Error\",\"Please fill in a valid name\");\n        return;\n    }\n    _this.form.findField('name').setValue(name);\n \n    _this.form.doAction('submit');\n    \n}"
+      "|click" : "function() {\n\n    var name =     _this.form.findField('name').getValue();\n    name = name.toUpperCase().replace(/[^A-Z0-9]+/g, '');\n    if (!name.length) {\n        Roo.MessageBox.alert(\"Error\",\"Please fill in a valid name\");\n        return;\n    }\n    _this.form.findField('name').setValue(name);\n \n    _this.form.doAction('submit');\n    \n}"
      },
      "text" : "OK",
      "xtype" : "Button",
index 273763a..aed333c 100644 (file)
@@ -35,7 +35,7 @@ Pman.Dialog.CoreEnum = {
 
   this.callback = cb;
   this.data = data;
-  this.dialog.show(this.data._el);
+  this.dialog.show.apply(this.dialog,  Array.prototype.slice.call(arguments).slice(2));
   if (this.form) {
    this.form.reset();
    this.form.setValues(data);
@@ -91,7 +91,7 @@ Pman.Dialog.CoreEnum = {
        click : function() {
         
             var name =     _this.form.findField('name').getValue();
-            name = name.toUpperCase().replace(/[^A-Z]+/g, '');
+            name = name.toUpperCase().replace(/[^A-Z0-9]+/g, '');
             if (!name.length) {
                 Roo.MessageBox.alert("Error","Please fill in a valid name");
                 return;