Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

zhuth 7 years ago
parent
commit
a40f59ee4b

+ 5 - 0
frontend/saas-web/overrides/form/field/TextField.js

@@ -0,0 +1,5 @@
+Ext.define('saas.override.form.field.TextField', {
+    override: 'Ext.form.field.Text',
+    vtype: 'trim'
+
+});

+ 15 - 0
frontend/saas-web/overrides/form/field/TrimVtype.js

@@ -0,0 +1,15 @@
+Ext.define('saas.override.form.field.TrimVtype', {
+    override: 'Ext.form.field.VTypes',
+
+    // vtype validation function
+    trim: function(value) {
+        return this.trimRe.test(value);
+    },
+    // RegExp for the value to be tested against within the validation function
+    trimRe: /^(?! ).*(?<! )$/i,
+    // vtype Text property: The error text to display when the validation function returns false
+    trimText: '请不要在内容的开头和结尾添加空格',
+    // vtype Mask property: The keystroke filter mask
+    trimMask: /[\d\s:amp]/i
+
+});