[英]I can't seem to get resourceId on eventDrop and drop, im using resourceTimelineMonth and are trying to move them around
I can't seem to get resourceId on eventDrop and drop, im using resourceTimelineMonth and are trying to move them around.我似乎无法在 eventDrop 和 drop 上获取 resourceId,我正在使用 resourceTimelineMonth 并试图移动它们。
If i try info.resourceId i get "undefined".如果我尝试 info.resourceId 我得到“未定义”。
editable: true,
droppable: true,
eventResize: function (info) {
alert("Resize event: " + info.event.id + info.event.title + " end is now " + info.event.end.toISOString());
if (!confirm("Gem?")) {
info.revert();
}
SetEvent(info);
},
eventDrop: function (info) {
console.log('resourceId: ' + info.resourceId);
//alert(info + " Drop event: " + info.event.title + " was dropped on " + info.event.start.toISOString());
console.log(info.title);
//SetEvent(info);
},
drop: function (info) {
// is the "remove after drop" checkbox checked?
console.log("Drop event: " + info.resourceId);
//SetEvent(info);
}
On eventResize and eventDrop you can find the resource id under: info.event._def.resourceIds[0]在 eventResize 和 eventDrop 上,您可以在以下位置找到资源 ID: info.event._def.resourceIds[0]
On drop you can find it under: info.resource._resource.id你可以在下面找到它:info.resource._resource.id
On eventResize and eventDrop you can find the resource id under: info.event._def.resourceIds[0]在 eventResize 和 eventDrop 上,您可以在以下位置找到资源 ID: info.event._def.resourceIds[0]
On drop you can find it under: info.resource._resource.id你可以在下面找到它:info.resource._resource.id
You can also use event.getResources()
so that you can get more information about the resource: id, title...您还可以使用
event.getResources()
来获取有关资源的更多信息:id、title...
https://fullcalendar.io/docs/Event-getResources https://fullcalendar.io/docs/Event-getResources
For example:例如:
eventDrop: function(info) {
var infoResources = info.event.getResources();
var resourceId = infoResources[0]._resource.id;
var resourceTitle = infoResources[0]._resource.title;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.