On March 6th, 2008 David Ethell (not verified) says:
I found the problem. removeEventsByDate is too aggressive in the default mode where you just supply a date and not a second argument saying which event on that date to remove. Here is line 100 from the current version:
this.cells[cellIndex].select('.dayboxvalue').invoke('remove');
The problem with that is that it removes the entire dayboxvalue div element, yet the setPlannerValue function depends on that div still existing so it can put new p elements inside it. Rather than remove the entire dayboxvalue div if no arguments are given to removeEventsByDate we should just loop through all the p elements in that div and remove them. So I removed line 100 and added this and it works fine now:
for(var index = this.cells[cellIndex].select('.dayboxvalue p').length - 1; index >= 0; index--)
this.cells[cellIndex].select('.dayboxvalue p')[index].remove();
Here is the fix
I found the problem. removeEventsByDate is too aggressive in the default mode where you just supply a date and not a second argument saying which event on that date to remove. Here is line 100 from the current version:
this.cells[cellIndex].select('.dayboxvalue').invoke('remove');
The problem with that is that it removes the entire dayboxvalue div element, yet the setPlannerValue function depends on that div still existing so it can put new p elements inside it. Rather than remove the entire dayboxvalue div if no arguments are given to removeEventsByDate we should just loop through all the p elements in that div and remove them. So I removed line 100 and added this and it works fine now:
for(var index = this.cells[cellIndex].select('.dayboxvalue p').length - 1; index >= 0; index--)
this.cells[cellIndex].select('.dayboxvalue p')[index].remove();
Hope that helps,
David