From 8bc2e7a54b4ea36f5a9d2046020c54d732e59621 Mon Sep 17 00:00:00 2001 From: Alan Date: Wed, 27 Oct 2021 15:42:03 +0800 Subject: [PATCH] fix name on enum save --- Pman.Dialog.CoreEnum.bjs | 6 +++--- Pman.Dialog.CoreEnum.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pman.Dialog.CoreEnum.bjs b/Pman.Dialog.CoreEnum.bjs index a13189f0..6dd5f210 100644 --- a/Pman.Dialog.CoreEnum.bjs +++ b/Pman.Dialog.CoreEnum.bjs @@ -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" : [ @@ -126,7 +126,7 @@ }, { "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", diff --git a/Pman.Dialog.CoreEnum.js b/Pman.Dialog.CoreEnum.js index 273763ab..aed333cb 100644 --- a/Pman.Dialog.CoreEnum.js +++ b/Pman.Dialog.CoreEnum.js @@ -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; -- 2.39.2