- Thank you for reporting this bug. We will make it our priority to review this report. 
- Timefield and allowBlank - Timefield and allowBlank- Hello. 
 Component 'timefield' ignore parameter allowBlank: true.
 Please open this example: http://ift.tt/1rhSz2v- Test case: 
 1. Select any time in field
 2. Clear text in field
 3. Press button "Validate"- TimeField show error: ' is not a valid time'. - Temporary "dirty" fix: - Code: 
 Ext .override(Ext .form .field .Time, {
 getErrors: function (value) {
 var me = this ,
 format = Ext .String .format,
 errors = me.callParent(arguments),
 minValue = me.minValue ,
 maxValue = me.maxValue ,
 data = me.displayTplData ,
 raw = me.getRawValue(),
 i, len, date, item;
 //temporay dirty fix for 5.0.1
 if(!raw && me.allowBlank)
 return [];
 if (data && data.length > 0) {
 for (i = 0, len = data.length; i < len; i++ ){
 item = data[i];
 item = item.date || item.disp ;
 date = me.parseDate(item);
 if (!date )
 if (!date) {
 errors.push(format(me.invalidText , item, Ext .Date .unescapeFormat(me.format)));
 continue ;
 }
 if (minValue && date < minValue) {
 errors.push(format(me.minText , me.formatDate(minValue)));
 }
 if (maxValue && date > maxValue) {
 errors.push(format(me.maxText , me.formatDate(maxValue)));
 }
 }
 } else if (raw.length && !me.parseDate(raw)) {
 // If we don't have any data & a rawValue, it means an invalid time was entered.
 errors.push(format(me.invalidText , raw, Ext .Date .unescapeFormat(me.format)));
 }
 return errors;
 }
 });
 
Timefield and allowBlank
 
Aucun commentaire:
Enregistrer un commentaire