In the fullcalendar scheduler, I need the eventDragStop to execute a call back function, ONLY when the user drag and drop to the same date time, while do not execute anything if the user drag and drop to a different time zone.
在fullcalendar调度程序中,我需要eventDragStop来执行回调函数,仅当用户拖放到同一日期时间时,而如果用户拖放到不同时区,则不执行任何操作。
The code snippet is below:
代码片段如下:
eventDragStop: function(event, jsEvent, ui, view) { ... }
I cannot get another information on whether the user drag and drop to the same or different date time.
我无法获得关于用户拖放到相同还是不同日期时间的其他信息。
更多回答
优秀答案推荐
For your question i think we need to setup a callback function, which will be triggered when the dragEvent stops and then verify the value dragged event.
To setup this we need to configure calendarOptions as
对于您的问题,我认为我们需要设置一个回调函数,该函数将在dragEvent停止时触发,然后验证值拖动事件。要进行设置,我们需要将calendarOptions配置为
public calendarOptions: CalendarOptions = {
//your normal settings here,
eventDragStop: this.eventDragStop.bind(this),
};
then
然后
eventDragStop(arg: EventDragStopArg): void {
//arg?.jsEvent?.clientX
//arg?.jsEvent?.clientY
}
can write any logic you want inside the eventDragStop
and make use of the EventDragStopArg
model as needed. also if it concerned of dragging to a outside element, its better to fine the offset of those element and compare as needed.
可以在eventDragStop中编写任何需要的逻辑,并根据需要使用EventDragStopArg模型。此外,如果它涉及到拖动到外部元素,最好对这些元素的偏移进行微调,并根据需要进行比较。
Hope this helps :)
希望这能有所帮助:)
更多回答
我是一名优秀的程序员,十分优秀!