AjaxSaveResponse, checking for conflicts

Hi,
When users drag and drop events, I assume I should check for conflicts during the CRUD operations, as shown here:
scheduler-net.com/docs/managing_ … tions.html

If that’s the case, I am returning the following on conflict:

        var action = new DataAction(actionValues);
        action.TargetId = changedEvent.id;
        action.Message = "NoWay!";
        action.Type = DataActionTypes.Error;
        return (new AjaxSaveResponse(action));

I would think the result would be that the event that was dragged and dropped would be put back to it’s original location, and the “NoWay!” message would display. That is not happening, it just leaves the event in the newly dropped position. Am I missing something?

Thanks
Mike

Hi,
dataprocessor doesn’t revert changes automatically
You can use onBeforeLightbox and onBeforeEventChanged events to backup event before it’s modified
docs.dhtmlx.com/doku.php?id=dhtm … relightbox
docs.dhtmlx.com/doku.php?id=dhtm … entchanged

and onAfterUpdate event of the dataProcessor to rollback changes when it’s necessary:scheduler.dataProcessor.attachEvent("onAfterUpdate", function(sid, action, tid, tag){ if (action == "error"){ ... } });

Hi,
Thanks, I will try it. Am I heading down the right path for collision detection? For example, if someone drags an event to the same date/time as another event using the same Room for example, is this how I should be detecting the collision and stopping it?
Thanks
Mike

Its one of possible strategies.
In case of dhtmlxScheduler you may have all info about events already on client side, so you can check collisions there ( in fact scheduler has an extension for it )