问题
The title of the question probably does not fully represent the dynamics that I am about to explain.
I'm working with FullCalendar and with an open source library that allows me to add resources at the top, you can see the result of this JsFiddle.
As you can see every event is assigned to a resource (first column, second column)
. In fact we have two events:
Meeting 1 = First Column
Meeting 2 = Second Column
What I want to do is move Meeting 1 to second column (through the mouse of course) and be able to get through code the details of the column on which I moved the event, in this case the affected column is Second Column
.
I thought of a solution:
select: function(dtStart, dtEnd, jsEvent, event)
{
console.log(event.column, event.columnData);
}
Initial result
Final result
but it is just turned so I'm probably wrong logic.
I need to get the property of the column id and name defined in the FullCalendar
option:
multiColAgendaWeek:
{
type: 'multiColAgenda',
duration: { weeks: 1 },
columns: [
{ id: 1, name: 'First Column' },
{ id: 2, name: 'Second Column' }
]
}
Which one of you can help me do this?
回答1:
Have you tried the eventDrop
callback? If you add this -
eventDrop: function(event, delta, revertFunc) {
console.log(event);
}
After your events array you'll be able to see how you can access any specific event data. Also, it would be very helpful if you would post the documentation on the specific FullCalendar fork that you're using if you have any other questions.
来源:https://stackoverflow.com/questions/33320164/how-to-get-the-details-of-appointment-in-shift-event-fullcalendar