OnAdd, is provided by the plugin, but to be used at a diferent level, and replace the default behaviour.
I presume you need an event, before the item get's added, is that it?
Here is how we add an item.
- Code: Select all
function TIWCGJQCustomScheduler.AddHandler(AParams: TStrings; ASObj: ISuperObject): ISuperObject;
var
Event: TIWCGJQSchedulerEvent;
begin
Result:= nil;
Event:= JQSchedulerOptions.EventItems.Add;
// GetNewID event
Event.ID:= GetNewEventID(Event);
Result:= SO(Event.ID);
Event.Subject:= AParams.Values['CalendarTitle'];
Event.StartTime:= StrToDateTime(AParams.Values['CalendarStartTime'],GetWorkingFormatSettings);
Event.EndTime:= StrToDateTime(AParams.Values['CalendarEndTime'],GetWorkingFormatSettings);
Event.AllDay:= AParams.Values['IsAllDayEvent'] <> '0';
Event.Editable:= True;
end;
With best regards