I am trying to setup a scenario where old events are read only, however future events can be changed.
I have coded it so that when a reoccurring event is changed that the old one’s end date is set and that it creates a new one. However the one thing I do not have is the event that the user selected.
The scheduler has an option to edit the series or the current one. However I am in need of another option “All following events”. If I knew the date of the event that the user clicked I could use that, however at the moment all I get from the ev is the start_date of the parent event.
Is there a way to know which date the user clicked of any given reoccurring event?
Hi,
could you clarify how exactly did you try to retreive a date of a clicked event?
E.g. following code returns a correct date, when you double click on series event
I have attached an example. The sequence starts on the 14th but if I click on the 16th, the events start_date is 14th. I need to know the date of the clicked event, not the date of the very first in the sequence.
Hi,
thanks for the demo.
In the attached event you can get start date of the clicked occurance (file “elm-scheduler.js”, line 11):
scheduler.attachEvent("onClick", function (id, e){
scheduler.showLightbox(id);
return true;
});
the method mentioned above returns the correct start date (16th) of the clicked event.
Thank you for your assistance. The onClick event did indeed have the date I was looking for and I now have coded the change so that all subsequent events are altered.
The suggestion that onBeforeLightbox contains the selected events start_date did not hold true. It returned me the initial events start_date.
The value date value in onBeforeLightbox handler depends on mode of the lightbox (‘edit occurence’ or ‘edit series’) which can be selected in confirm popup, or set in config.
When the lightbox is opened for editing the series, the dates will contain start-end dates of the whole series.
At that stage, retrieving info on the originally clicked event is not possible.
The only way to achieve this is to save an id or a date of the clicked occurence into some variable in onClick or onDblClick handler
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan