Hi,
today i play around the sample of the CalendarExtender from the live demo page,
the third example is using the CalendarExtender with the imageButton,
when i click on the imageButton at the first time, the calendar is popup, then i simple select the date, click on it, the date was selected, fine.
but, when i trying to open the calendar popup, and choose nothing but click again on the imageButton,
the page was fully postback and my previous selected date on the textbox was gone.
at the end i got to solve this with no using the image button but normal image tag.
is that consider a bug?
or i missed something?
I have also discovered that the second click on the image button will force a postback.
I fixed it in the CalendarBehavior.js file like this:
In the _button_onclick function there is an 'if' statment thus
if (!this._isOpen) {
e.preventDefault();
e.stopPropagation();
if (this._enabled)
this.show();
} else {
this.hide();
}
I moved the event function invocations out of the 'if' statement like this:
e.preventDefault();
e.stopPropagation();
if (!this._isOpen) {
if (this._enabled)
this.show();
} else {
this.hide();
}
This seems to work for me on both IE and Firefox. Note that I haven't tested it fully though.
No comments:
Post a Comment