Welcome Guest Search | Active Topics | Sign In | Register

DatePicker Client side events Options
Jimsurf
Posted: Wednesday, June 16, 2010 7:17:31 PM
Rank: Newbie
Groups: Member

Joined: 6/16/2010
Posts: 4
I have a date picker and would like to register a change event in the pre render event.
The event I prefer is ClientSideOnChange, but I could use any client event that corresponds to the selection of a date.
What event could I use DatePicker.Attributes.Add for in the prerender event?
Code: C#
protected void RevisedCloseDatePickerInsert_PreRender(object sender, EventArgs e)
    {
        DatePicker RevisedCloseDatePicker = (DatePicker)ClosingFormView.FindControl("RevisedCloseDatePicker");
        //RevisedCloseDatePicker.Attributes.Add("ClientSideOnChange", "RevisedCloseDatePickerInsertChange();");
    }
Jimsurf
Posted: Wednesday, June 16, 2010 7:32:59 PM
Rank: Newbie
Groups: Member

Joined: 6/16/2010
Posts: 4
Ok, I can do this: RevisedCloseDatePicker.ClientSideOnChange = "RevisedCloseDatePickerInsertChange";
but how do I pass parameters dynamically? Is it even possible?
eo_support
Posted: Wednesday, June 16, 2010 9:27:27 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You do not pass parameter to an event handler. An event handler takes a list of pre-defined arguments (just like your Page_Load always takes two arguments). The DatePicker would pass the event arguments to your handler. If you would like to call another function with your own argument, you would need to put that code inside a different function such as:

Code: JavaScript
function event_handler_function(predefined_arguments......)
{
    another_function(your_own_arguments....);
}

Then use "event_handler_function" with the controls.

Thanks!
quirtep
Posted: Wednesday, June 23, 2010 6:19:53 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
I am having a similar issue. I have a DatePicker within a repeater. I want it to trigger a javascript function when the user selects a date, but how can the javascript function know which instance of the DatePicker called it? Is there any way at all to pass a parameter from the DatePicker to a client side function?
eo_support
Posted: Wednesday, June 23, 2010 7:51:09 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
quirtep wrote:
Is there any way at all to pass a parameter from the DatePicker to a client side function?


The only thing the DatePicker passes to the client side function is the DatePicker itself. You can not pass your own parameters.

quirtep
Posted: Wednesday, June 23, 2010 7:54:31 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
Is there an alternative method of accomplishing what I describe?
eo_support
Posted: Wednesday, June 23, 2010 8:06:18 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
There could be but it won't have anything to do with our control so there isn't much we can do for you. Basically all we can tell you is what you are looking for does not exist here and the rest is yours. Our support won't devise a solution for you.
quirtep
Posted: Wednesday, June 23, 2010 8:11:36 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
Umm, ok, but I would think that a basic example of your calendar control within standard repeater or other such template, would be simple support...


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.