search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

asyncpostbacktrigger with daypilot navigator

Asked by shimon
5 years ago.

hello,
i want to call some update panel with conditional trigger when the user change the selected date in daypilot navigator, but i cant find this event.
<asp:asyncpostbacktrigger controlId="datpilotnavigator1" eventname="???? "/>

what event name to choose?
thanks a lot

Answer posted by Dan Letecky [DayPilot]
5 years ago.

The navigator fires two events:

1. TimeRangeSelected when you click a date
2. VisibleRangeChanged when you click "next" or "previous" links at the top

You need to set TimeRangeSelectedHandling to "PostBack" - the default value is "Bind".

Comment posted by Anonymous
5 years ago.

Thank you very much, it works fine
but now the DayPilotCalendar not updated due to the navigator is PostBack and not bind.

any idea?

Comment posted by Dan Letecky [DayPilot]
5 years ago.

The default "Bind" event handling updates the target control (BoundDayPilotID) automatically.

See also:
http://doc.daypilot.org/navigator/navigation/

If you switch to "PostBack" it fires the TimeRangeSelected event handler instead.

Solution #1:

Add an event handler for TimeRangeSelected event. You will need to place the calendar in an UpdatePanel as well.

protected void DayPilotNavigator1_TimeRangeSelected(object sender, TimeRangeSelectedEventArgs e)
{
  DayPilotCalendar1.StartDate = e.Start;
  DayPilotCalendar1.DataBind();
  DayPilotCalendar1.Update();
  // update the update panel here
}

Solution #2:

Use TimeRangeSelectedHandling="JavaScript" and invoke both actions manually:

TimeRangeSelectedHandling="JavaScript"
TimeRangeSelectedJavaScript="dpc.commandCallBack('refresh', { 'start': start }); dpn.timeRangeSelectedPostBack(start, end)"

Where "dpn" is DayPilotNavigator.ClientObjectName and "dpc" is DayPilotCalendar.ClientObjectName.

Comment posted by Anonymous
5 years ago.

it works now, much slower but works...
thank you!

This question is more than 6 months old and has been closed. Please create a new question if you have anything to add.