How to get the details of appointment in shift event FullCalendar

荒凉一梦 提交于 2019-12-12 01:57:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!