How to refresh an event after an update with custom modal

Hi!

I have these scenarios:

  • I have a custom modal window and I need to update only the event I just udpated/added.
  • I need to delete an event after delete with sidebar button without reloading the whole calendar.

The main issue here, is that, with so many events in a month, the loading takes forever, and it always takes me to the current week/month.
Are there any examples online for this?
Thanks in advance.

Javier

Hi,
as far as i remember custom form in our sample does not reloads the whole calendar,
it just updates single event(’.Net form in lightbox’ sample, server side in MVCFormInLightboxController.cs) . Are you using some custom solution for the details form?

btw, you can speed up initial data loading with DynamicLoading mode of the scheduler. With dyn. loading enabled scheduler can load events only for the viewable area(e.g. current month)
http://scheduler-net.com/docs/loading_data.html#big_datasets

You can use javascript api of scheduler, which allow to update or delete events without full page reloading.

Delete button

<input type='button' value='delete event' onclick='scheduler.deleteEvent(123)' >

where 123 - id of event

Hi everybody,
Thanks for your answers…

My solution ended up coming this way…

scheduler.attachEvent("onBeforeEventDelete", function (event_id, event_object) {
            var id = event_object.ID;
            $.ajax({ url: "/Events/DeleteEvent", type: "POST", dataType: "json", data: { eventID: id} });
            return true;
        });

The return true made the trick in this case. (I’m using the delete button on the button bar). Couldn’t find any other way to do it. If I use it like this it just refreshes the deleted event.

Now, how can i do this with the update?
I have a custom window (a different window) for updates.

Thanks in advance.
Javier

To elaborate a little more, this is my situation.

I use a different window as modal window (not the custom modal that comes with the calendar), so I need to be able to update just one event after the update or the cancel.


scheduler.attachEvent("onDblClick", function (id) {
            if (scheduler.getEvent(id)) {
                EditEvent(scheduler.getEvent(id).ID);
            }
        });

        scheduler.attachEvent("onBeforeLightbox", function (id) {
            var ids = scheduler.getEvent(id).ID;
            if (ids != undefined) {
                if (scheduler.getEvent(id)) {
                    EditEvent(scheduler.getEvent(id).ID);
                }
            }
            else {
                if (scheduler.getEvent(id)) {
                    var dDia = scheduler.getEvent(id).start_date.getDay();
                    var dMes = scheduler.getEvent(id).start_date.getMonth();
                    var dAnio = scheduler.getEvent(id).start_date.getYear();
                    var dHora = scheduler.getEvent(id).start_date.getHours();
                    var dMinutos = scheduler.getEvent(id).start_date.getMinutes();

                    var hDia = scheduler.getEvent(id).end_date.getDay();
                    var hMes = scheduler.getEvent(id).end_date.getMonth();
                    var hAnio = scheduler.getEvent(id).end_date.getYear();
                    var hHora = scheduler.getEvent(id).end_date.getHours();
                    var hMinutos = scheduler.getEvent(id).end_date.getMinutes();

                    NewEvent(scheduler.getEvent(id).start_date, scheduler.getEvent(id).end_date);
                }
            }

        });

Can I use the client API to update only one event after I save/cancel my custom event modal?

Thanks in advance!