我正在使用extjs datefield
Ext.create('Ext.form.Panel', {
renderTo: Ext.getBody(),
width: 300,
items: [{
xtype: 'datefield',
fieldLabel: 'From',
maxValue: new Date()
}, {
xtype: 'datefield',
fieldLabel: 'To',
}]
});
在extjs 4中使用此代码时,它可以完美地禁用今天日期之后的所有日期,使用maxValue= now Date()
完成。在extjs 5中,用户无法选择今天日期之后的任何日期,但不会禁用。
如何禁用这些日期??
提前致谢
答案 0 :(得分:0)
不确定是否可以......无效日期已被授予正确的课程,并且具有所有正确的设置。但HTML不同。
在Ext4中,用于渲染日期单元格的模板是
'<a role="presentation" hidefocus="on" class="{parent.baseCls}-date" href="#"></a>',
但是在Ext5中,模板是
'<div hidefocus="on" class="{parent.baseCls}-date"></div>',
另一个问题是样式的SASS代码仍假定单元格是A
标记,而不是DIV
// include the element name since :hover causes performance issues in IE7 and 8 otherwise
a.#{$prefix}datepicker-date:hover {
color: $datepicker-item-color; // needed to override color for prevday/nextday
background-color: $datepicker-item-hover-background-color;
}
简而言之,这似乎是ExtJS 5中的一个错误 - Javascript小部件已被转换,但CSS并不是。我建议跟他们一起提出错误。