Hi there,
I’m working with recurring events in the scheduler and I have a bit of a “refreshing” problem, so to speak. Here’s the situation:
First of all, I’ve made it so that when a person saves a recurring event, it saves each occurrences physically in the database as a separate event. This part works very well and keeps the data consistent. The problem occurs when a person tries to update a recurring event’s recurrence pattern.
For clarity purposes, I’ve included a screenshot of my lightbox, so in reference to that particular picture, let’s assume someone changes the recurrence number from 3 to 4… it’ll physically insert a new event mirroring the rest of the series. This part works really well and I see the new event appearing on the scheduler.
However, the problem comes when someone changes the value from 4 to three, thus deleting an event in the series. Now, server-side, there’s no problem. The event is indeed deleted from the database, but the problem is that it still shows up on the scheduler. I have this in the init function:
function init() {
var sections = scheduler.serverList("listeEmployes");
scheduler.locale.labels.employe_tab = "Employés";
scheduler.locale.labels.day_tab = "Jour";
scheduler.locale.labels.week_tab = "Semaine";
scheduler.locale.labels.month_tab = "Mois";
scheduler.locale.labels.today_button = "Aujourd'hui";
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.config.prevent_cache = true;
scheduler.config.first_hour=8;
scheduler.config.start_on_monday = false;
scheduler.createUnitsView({
name:"employe",
property:"ANoPersonne",
list:sections
});
scheduler.config.details_on_create=true;
scheduler.config.details_on_dblclick=true;
scheduler.config.multi_day = true;
if (gup('date') == "")
scheduler.init('scheduler_here',new Date(),"week");
else
scheduler.init('scheduler_here',new Date(gup('date').split('-')[0],gup('date').split('-')[1] - 1,gup('date').split('-')[2]),"employe");
//scheduler.setLoadMode("month")
scheduler.load("calendrierConnecteur.php", function(){
if (gup('id') != "")
scheduler.showLightbox(gup('id'));
});
var dp = new dataProcessor("calendrierConnecteur.php");
dp.enableUTFencoding(false);
dp.init(scheduler);
dp.attachEvent("onAfterUpdateFinish", function(sid, action, tid)
{
scheduler.load("calendrierConnecteur.php");
return true;
});
}
As you can see, I’ve put a “scheduler.load” statement in the “onAfterUpdateFinish” event of the dataprocessor, but it does absolutely nothing. I’ve also tried the “onAfterUpdate” event and it’s the same. So, where do I put the refresh statement so that the deleted event will disappear correctly?
Thanks in advance,
Osu