| Issue 1851: | Event modifies other event, even when the IDs are completely different | |
| 1 person starred this issue and may be notified of changes. | Back to list |
I am trying to do something where, when I click on an event, it places a new event on the calendar. This new event spans 1 hour, and has the same start date as the clicked event:
eventClick: function(event) {
var startDate = event.start
var endDate = startDate.addHours(1) // using the Datejs library
var eventObject = {
id: SetGreatestId(), //function that tracks the currently greatest id, also returns that value +1.
title: "New Event",
editable: true,
start: startDate,
end: endDate,
color: "grey"
}
$(element).fullCalendar('renderEvent', eventObject, true)
}
The above function works fine. The event gets rendered in the expected position. The problem is when I try to modify the start date of the new event.
The problem is this: the start date of the originally clicked event always follows the start date of the new event. I have been banging my head against the wall trying to fix it to no avail.
When I drag the event upwards, the start date of the originally clicked event moves with it (the originally clicked event has editable set to false as well), and it is not meant to do this. In fact, the start date of the clicked event always follows the start date of the new event. When the new event is dragged down so that its start date exceeds the end date of the clicked event, the clicked event does something weird where it tries to render the event such that the start date comes after the end date.
This is all because the start date of the clicked event is for some reason linked to the start date of the new event.
When I drag a new event within the span of the same originally clicked event, everything works fine and as expected.
Aug 24, 2013
Project Member
#1
adamrs...@gmail.com
Status:
Done
|
|
| ► Sign in to add a comment |