Hello,
In my scheduler I need to add functionality that removes all events with the same name. User should be able to do this by dbl-cklicking one of those events and clicking a button in a custom lightbox.
Than all those events will be deleted and a new one created and inserted in to scheduler.
Now my question is what should be the return from CustomSave action method for the scheduler to update properly ?
It’s pretty standard when one event is inserted/deleted/updated but what if this should be done on multiple events with one call to CustomSave?
[code]public ActionResult CustomSave(CalendarEvent changedEvent, FormCollection actionValues)
{
var action = new DataAction(DataActionTypes.Update, changedEvent.id, changedEvent.id);
if (actionValues["actionButton"] != null)
{
try
{
if (actionValues["actionButton"] == "DeleteAndInsert")
{
//delete all events where name ='...'
_repositoryEvents.Delete(changedEvent.Name);
//create a new event
//.... some code
//Insert new event to dataBase
_repositoryEvents.Insert(newEvent);
}
}
catch
{
action.Type = DataActionTypes.Error;
}
}
else
{
action.Type = DataActionTypes.Error;
}
//! what to return here ?
return (new SchedulerFormResponseScript(action, changedEvent));
}[/code]