zhuth 7 years ago
parent
commit
d213fd8866

+ 6 - 2
frontend/saas-web/ext/packages/ux/src/feature/MySummary.js

@@ -19,8 +19,7 @@ Ext.define('Ext.ux.feature.MySummary', {
     summaryRowCls: Ext.baseCSSPrefix + 'grid-row-summary ' + Ext.baseCSSPrefix + 'grid-row-total',
     summaryRowSelector: '.' + Ext.baseCSSPrefix + 'grid-row-summary.' + Ext.baseCSSPrefix + 'grid-row-total',
 
-    // turn off feature events.
-    hasFeatureEvent: false,
+    showSummaryRow: true,
 
     init: function(grid) {
         var me = this,
@@ -71,6 +70,7 @@ Ext.define('Ext.ux.feature.MySummary', {
                         '</table>',
                     ],
                     data: summarys,
+                    height: 36,
                     scrollable: {
                         x: false,
                         y: false
@@ -114,6 +114,10 @@ Ext.define('Ext.ux.feature.MySummary', {
 
         grid.summarys = summarys;
 
+        if(summarys.length == 0) {
+            me.showSummaryRow = false;
+        }
+
         return summarys;
     },
 

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

@@ -3,10 +3,10 @@ Ext.define('saas.override.form.field.TrimVtype', {
 
     // vtype validation function
     trim: function(value) {
-        return this.trimRe.test(value);
+        return !this.trimRe.test(value);
     },
     // RegExp for the value to be tested against within the validation function
-    trimRe: /^(?! ).*(?<! )$/i,
+    trimRe: /(^ .*)|(.* $)/,
     // vtype Text property: The error text to display when the validation function returns false
     trimText: '请不要在内容的开头和结尾添加空格'
 });