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

Drag&Drop External and call back

Asked by Olivier
13 years ago.

I'm using your excellent DayPilot Scheduler and will buy it very soon.

But before that, I want to improve some points.

I'm using a lot of callback event to have a fast solution.

I'm using an html table to drag from this list items to be put on the scheduler. This html table is on a Ajax update panel to be able to refresh it without any postback or "blank" screen.

All is perfect, exect for one point.

If an event on the scheduller is "remove" from the scheduller, or if the e.end-e.start is < event.planifed_time, then I want to be able to "refresh" my list of event to be plan.

The problem is that I cannot call the updatePanel.Refresh method on the call back, and I don't want to set the type "Post Back" for this kind of events, just for this.

What I've done for the moment is a html href that will call a javascript to update my panel. But the user must click on this "dimmy" link to update the panel. It would be perfect if this "link click" is done directly by the scheduller.

SO, is it possible to add an option on the method to be able to call a javascript method when an event is fired.

For exemple, EventResize: type is callback, and javascript method to call after is "updateMyFreshPanel()"

Best Regards,

Olivier

Comment posted by Dan Letecky
13 years ago.
Hi Olivier,

You have two choices:

1. Use UpdatePanel from ASP.NET AJAX Extensions. That way you will be able to update two panels at the same time (just one callback). The drawback is that UpdatePanel refreshes DayPilot completely so the drawing will be slower.

2. If you are able to identify this event on the server-side, you can send back some custom data when calling DayPilotCalendar.Update():

DayPilotCalendar.Update("refreshMyList");

Then define a custom method in AfterRenderJavaScript (AfterRenderJavaScript="afterCallBack(data)"). data property will hold the "refreshMyList" value. I.e. you can use:

function afterCallBack(data) {
if (data == 'refreshMyList') {
updateMyFreshPanel();
}
}

Actually, this will execute two callbacks but most likely it will still be faster than putting DayPilot inside an UpdatePanel.
Comment posted by Olivier
13 years ago.
Hello.

Big Thanks, your method was the good one (2) and it works perectly !
This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.