I am using the scheduler component in a production application with real customers. Overall, the scheduler is working well; however, a few customers have contacted me very frustrated saying things like "data is being lost, schedules (occurrences) are being lost or deleted, ...". I am posting this to see if others have had similar problems and to make others aware of potential causes (possibly alleviating some frustration).
In our case, two scenarios were causing the confusion. Note: "Problem 2" is more severe in my opinion. Below are the steps to reproduce each problem:
Problem 1 - Steps to Reproduce:
1. Create a repeating event (for example, repeat every 1 week on Monday through Friday) and note the "Start Date" which will default to the date for the cell you originally clicked.
2. Move ahead a week or two and click on one of the repeating occurrences
- click "Edit the series"
- then click "Delete"
- then click "Delete current occurrence"
3. You will see that that occurrence that you clicked was not deleted. If you move back to the "Start Date" for the series (noted in step 1), you will see that it has been deleted.
I would have expected the "Delete" button to delete the occurrence that I clicked, not the first occurrence. I put in a ticket for "Problem 1", the rep agreed that this scenario would confuse an end user, and stated that some sort of change to the interface will be made in a future release.
My workaround for Problem 1:
Hide the "Delete" button on the popup edit window using css (occurrences and series can still be deleted with the "x" button):
.k-scheduler-edit-form .k-edit-buttons .k-scheduler-delete {
display: none;
}
Problem 2 - Steps to Reproduce:
1. Create a repeating event (for example, repeat every 1 week on Monday through Friday)
2. Move ahead a week or two and click on one of the repeating occurrences (note the date)
- click "Edit current occurrence"
- make a change (such as extending the time range) and save
3. Move back a week and click on one of the repeating occurrences
- click "Edit the series"
- make a change to the Description
- click Save
4. Move forward to the occurrence modified in step 2 and you will see that your change has been lost
Our customers are scheduling job workers. They make changes to the schedule for holidays, deviations, and so on. Sometimes, scheduling months ahead and making many changes (editing many occurrences in a series) . Then, all of those changes are totally lost when the series itself is modified and saved. This is a major problem that has frustrated one customer to the point of stating that our schedule implementation is not usable.
I am not sure what the solution to this is; however, I put in a ticket for it yesterday. In the meantime, I wanted to make others aware.
My workaround for Problem 2:
Modified kendo code to change the series occurrence edit and save logic to result in the creation of a totally new occurrence (unrelated to the series). I figured out the workaround by looking at the database records for a series containing modified occurrences and taking note of how the "RecurrenceID" and "RecurrenceException" fields were being used. 2 changes for the workaround:
1. Changed my web api controller POST (or insert) method to always set the "RecurrenceID" to null. This will result in the inserted occurrence being unrelated to the series. Something like this:
public HttpResponseMessage PostSchedule(Schedule schedule)
{
if (ModelState.IsValid)
{
// set RecurrenceID to null;
schedule.RecurrenceID = null;
db.Schedules.Add(schedule);
db.SaveChanges();
HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, new[] { schedule });
response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = schedule.ScheduleId }));
return response;
}
else
{
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
}
}
2. Changed the kendo code to never clear the "RecurrenceException" field. When a series is modified and saved, the exceptions are deleted. In this case, we don't want that to ever happen because we have created a new occurrence on those exception dates. To do this, I commented out the code in the "_removeExceptions" function:
_removeExceptions: function (model) {
// commented out
},
In our case, two scenarios were causing the confusion. Note: "Problem 2" is more severe in my opinion. Below are the steps to reproduce each problem:
Problem 1 - Steps to Reproduce:
1. Create a repeating event (for example, repeat every 1 week on Monday through Friday) and note the "Start Date" which will default to the date for the cell you originally clicked.
2. Move ahead a week or two and click on one of the repeating occurrences
- click "Edit the series"
- then click "Delete"
- then click "Delete current occurrence"
3. You will see that that occurrence that you clicked was not deleted. If you move back to the "Start Date" for the series (noted in step 1), you will see that it has been deleted.
I would have expected the "Delete" button to delete the occurrence that I clicked, not the first occurrence. I put in a ticket for "Problem 1", the rep agreed that this scenario would confuse an end user, and stated that some sort of change to the interface will be made in a future release.
My workaround for Problem 1:
Hide the "Delete" button on the popup edit window using css (occurrences and series can still be deleted with the "x" button):
.k-scheduler-edit-form .k-edit-buttons .k-scheduler-delete {
display: none;
}
Problem 2 - Steps to Reproduce:
1. Create a repeating event (for example, repeat every 1 week on Monday through Friday)
2. Move ahead a week or two and click on one of the repeating occurrences (note the date)
- click "Edit current occurrence"
- make a change (such as extending the time range) and save
3. Move back a week and click on one of the repeating occurrences
- click "Edit the series"
- make a change to the Description
- click Save
4. Move forward to the occurrence modified in step 2 and you will see that your change has been lost
Our customers are scheduling job workers. They make changes to the schedule for holidays, deviations, and so on. Sometimes, scheduling months ahead and making many changes (editing many occurrences in a series) . Then, all of those changes are totally lost when the series itself is modified and saved. This is a major problem that has frustrated one customer to the point of stating that our schedule implementation is not usable.
I am not sure what the solution to this is; however, I put in a ticket for it yesterday. In the meantime, I wanted to make others aware.
My workaround for Problem 2:
Modified kendo code to change the series occurrence edit and save logic to result in the creation of a totally new occurrence (unrelated to the series). I figured out the workaround by looking at the database records for a series containing modified occurrences and taking note of how the "RecurrenceID" and "RecurrenceException" fields were being used. 2 changes for the workaround:
1. Changed my web api controller POST (or insert) method to always set the "RecurrenceID" to null. This will result in the inserted occurrence being unrelated to the series. Something like this:
public HttpResponseMessage PostSchedule(Schedule schedule)
{
if (ModelState.IsValid)
{
// set RecurrenceID to null;
schedule.RecurrenceID = null;
db.Schedules.Add(schedule);
db.SaveChanges();
HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, new[] { schedule });
response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = schedule.ScheduleId }));
return response;
}
else
{
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
}
}
2. Changed the kendo code to never clear the "RecurrenceException" field. When a series is modified and saved, the exceptions are deleted. In this case, we don't want that to ever happen because we have created a new occurrence on those exception dates. To do this, I commented out the code in the "_removeExceptions" function:
_removeExceptions: function (model) {
// commented out
},