Showing posts with label demo. Show all posts
Showing posts with label demo. Show all posts

Saturday, March 24, 2012

Call Animation versus hooking an event

I'm looking for a way to perform an animation on a dynamically defined object.

For instance...Let's take the Toolkit demo animation where a dialog flies out from a button and the button is grayedout.

Assume there is a page that has a list of items and each item has an associated More... button. What I would like is to be able to call a function when I click the More... button that would pass the button and div to the AE that I want to flyout . This would prevent me from having to code an AE block for each item and hardcode the name of the control I want to hook for the onClick event. In the end I'm trying to accomplish two primary things: 1) Avoid writing the AnimationExtender block for every item by hand and hard coding the id of the link/button and the div tag [This would also reduce page size]. 2) Avoid writing a function in the code behind that has to programatic create the AE blocks [Avoiding this would increase speed of rendering].

Is this possible with the current functionality of the AE or would it require a rewrite?

Hi there,

I am also trying to do something on the same lines as you just mentioned. I just wanted to know if you were able to do the above mentioned task. Kindly let me know if you have any information about how this can be done.

Thanks in advance,

Cheers

Vishy


I have not been able to accomplish anything to this date. I have currently put it on the back burner pending more time to work on it.

Wednesday, March 21, 2012

CalendarExtender with ImageButton

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.