search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Scheduler Update method causes events to multiply acrross all resources.

Asked by Joe Tyrrell
16 years ago.
Hi there,

I am using the latest (8th December 2008) release of the DayPilot DEMO.

I have set EventMoveHandling="CallBack" and in the c# code on the server I have the following;

protected void DayPilotScheduler1_EventMove(object sender, DayPilot.Web.Ui.Events.EventMoveEventArgs e)
{
using (FTElectronicDiary ed = new FTElectronicDiary())
{
JobDetail job = ed.GetSingleJobDetail(int.Parse(e.Value));
if (e.NewResource != e.OldResource) { job.InspectorId = int.Parse(e.NewResource); }
job.StartDateTime = e.NewStart;
job.EndDateTime = e.NewEnd;
ed.UpdateJob(job);
LoadSchedulerEvents();
DayPilotScheduler1.Update(DayPilot.Web.Ui.Enums.CallBackUpdateType.EventsOnly);
}
} My problem is that whenever I call the Update method on DayPilotScheduler1 , instead of the event just moving to it's new location, I get multiple copies of the event appearing on the scheduler display vertically. In other words, the same event appears to repeat accross several Resources. I have checked the data I am assigning to the datasource property and it only contains one instance of each event. The method call I have to get the event data is the same one I use to initially populate the events at page load. If I perform a page refresh, the display renders as it should do and the event has moved to the correct location. It would seem from my perspective that there is a bug in the Update method. The LoadSchedulerEvents() method in the above code does the following; private void LoadSchedulerEvents()
{
JobDetail[] jobs;
jobs = Utility.GetJobsDateRange(DayPilotScheduler1.StartDate, DayPilotScheduler1.StartDate.AddDays(1));
Session["jobs"] = jobs;
DayPilotScheduler1.DataSource = jobs;
DayPilotScheduler1.DataBind();
} Please can you advise if this is an error on my part or if there is a genuine bug. I could not find any mention of this in the forums. Kind regards, Joe Tyrrell
Comment posted by Dan Letecky
16 years ago.

It's possible that there is bug inside DayPilot but in this case it's not likely.

For every row, only the resources with the matching resource id are rendered (i.e. Resource.Value == value of DataResourceField). If the e.NewResource or e.OldResource was incorrect because of a bug, it would rather disappear than be rendered multiple times.

My first guess would be that the Resource.Value is identical for several (probably all) Resources. Can that be the problem?

Comment posted by Anonymous
15 years ago.

Hi There,

Sorry for the delayed response. It's been a hectic Christmas.

The problem seemed to be due to & characters that where being included in the Resource descriptions. Some of the items had & as well. I filtered these out of the display name and all is well now.

I believe I will have to work out how to handle this situation but for now I will settle for what I have.

Thanks, Joe

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.