Browse Source

datefield默认最小最大值设为空

zhuth 6 years ago
parent
commit
74b45e6ce1
1 changed files with 15 additions and 0 deletions
  1. 15 0
      frontend/pc-web/overrides/form/field/Date.js

+ 15 - 0
frontend/pc-web/overrides/form/field/Date.js

@@ -1,6 +1,9 @@
 Ext.define('school.override.form.field.Date', {
     override: 'Ext.form.field.Date',
     formatText: '',
+	
+	minValue: null,
+	maxValue: null,
 
     setValue: function (v) {
         var me = this;
@@ -10,7 +13,19 @@ Ext.define('school.override.form.field.Date', {
             v = Ext.Date.format(v, me.format);
         }
 
+        me.setMinValue(null);
+        me.setMaxValue(null);
         me.callParent(arguments);
     },
 
+    /**
+     * 直接设置minValue发现不生效,添加一个boxready事件进行设置
+     */
+    listeners: {
+        boxready: function(f) {
+            f.setMinValue(f.minValue);
+            f.setMaxValue(f.maxValue);
+        }
+    }
+
 });