DanF
5 Jun 2007, 5:10 PM
Hi All
ext 1.01a, tested on FF 2 and IE7
I think I've found a bug with the DatePicker widget. If you set disabledDays after the picker has been shown once, the days on the first "screen" of the calendar don't change their disabled state. They do however change if you scroll forwards and back. I think it would also apply to setting minValue and maxValue if min and/or max are in the month that was last shown, but I haven't tested that bit. I should mention I'm using the DatePicker from within a DateMenu, and triggering the show from a div click
I've traced the bug to line 365 of DatePicker.js, which short circuits the setting of the classes based on the active month/year being the same as the selected month/year
update : function(date){
var vd = this.activeDate;
this.activeDate = date;
if(vd && this.el){
var t = date.getTime();
if(vd.getMonth() == date.getMonth() && vd.getFullYear() == date.getFullYear()){
//... inner code snipped
});
return;
I'm working around this by setting the private activeDate of the DatePicker to be a year fowards from the selected date each time I pop the DatePicker, but it smells like a nasty hack setting a private member!
I'd suggest either some methods for setMin, setMax, setDisabledDays, etc, but they could get rather verbose. A method called updateEnabledDates that then takes min+max+disabledDays+disabledDates etc could be handy as that's what I really want to do.
Loving ext btw, fantastic piece of kit!
ext 1.01a, tested on FF 2 and IE7
I think I've found a bug with the DatePicker widget. If you set disabledDays after the picker has been shown once, the days on the first "screen" of the calendar don't change their disabled state. They do however change if you scroll forwards and back. I think it would also apply to setting minValue and maxValue if min and/or max are in the month that was last shown, but I haven't tested that bit. I should mention I'm using the DatePicker from within a DateMenu, and triggering the show from a div click
I've traced the bug to line 365 of DatePicker.js, which short circuits the setting of the classes based on the active month/year being the same as the selected month/year
update : function(date){
var vd = this.activeDate;
this.activeDate = date;
if(vd && this.el){
var t = date.getTime();
if(vd.getMonth() == date.getMonth() && vd.getFullYear() == date.getFullYear()){
//... inner code snipped
});
return;
I'm working around this by setting the private activeDate of the DatePicker to be a year fowards from the selected date each time I pop the DatePicker, but it smells like a nasty hack setting a private member!
I'd suggest either some methods for setMin, setMax, setDisabledDays, etc, but they could get rather verbose. A method called updateEnabledDates that then takes min+max+disabledDays+disabledDates etc could be handy as that's what I really want to do.
Loving ext btw, fantastic piece of kit!