Hi,
How to make repeat event - enabled by default?
You can use onEventCreated handler and from it set default values of newly created event, it can be used to set default recurring mode as well.
( you will need to set rec_type and event_length properties for the newly created event )
Thank you for your reply. I am new to the schedular. Can you please give me sample code on how to set onEventCreated handler and what values should i pass to rec_type and event_length.
I have this code today
scheduler.config.lightbox.sections=[
{name:“description”, height:200, map_to:“text”, type:“textarea” , focus:true},
{name:“recurring”, height:115, type:“recurring”, map_to:“rec_type”, button:“recurring”},
{name:“time”, height:72, type:“time”, map_to:“auto”}
]
Thank you
scheduler.attachEvent(“onEventCreated”, function(event_id,event_object){
// how to set these values here rec_type and event_length
});
Hi when i use the below code, recurring events is enabled by default.
BUT no buttons, cancel, update they are not working. i cannot close the window after this.
please provide what should be the event_length
scheduler.attachEvent("onEventCreated", function(event_id,event_object){
var ev = this.getEvent(event_id);
ev.event_length = 0; // correct value?
ev.rec_type = "recurring"; // correct value?
return true;
});
Please help!
It must be something like
ev.event_length = (ev.end_date - ev.start_date)/1000; // length of event in seconds
ev.rec_type = ev.rec_pattern = "day_1___"; //repeat each day
Hi after adding this my cancel button does not work, the popup cannot be closed
also i only have weekly radio button on left side, removed daily, yearly radio buttons.
please help!
// after adding this close button does not work??
scheduler.attachEvent(“onEventCreated”, function(id) {
var ev = this.getEvent(id);
ev.event_length = (ev.end_date - ev.start_date)/1000; // length of event in seconds
ev.rec_type = ev.rec_pattern = “day_1___”; //repeat each day
return true;
})
Checked the same code in default sample - works normally
If issue still occurs - please provide any kind of sample where problem can be reconstructed.
Hi,
I want to make recurring events enabled by default with no end date
scheduler.attachEvent("onEventCreated", function(id) {
var ev = this.getEvent(id);
ev.event_length = (ev.end_date - ev.start_date)/1000; // length of event in seconds
ev.rec_type = ev.rec_pattern = "week_1___1,2,3,4,5#no"; //repeat each working day
return true;
});
After the event is created it repeats only one time like non-recurring one and in database ‘end_date’ is normal not like it should be: 9999-02-01 00:00:00.
I have to edit this event one more time to ensure that everything is correct.
A little help would be appreciated.