简体   繁体   English

我似乎无法在 eventDrop 和 drop 上获取 resourceId,我正在使用 resourceTimelineMonth 并试图移动它们

[英]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);
}

Edit编辑

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.

相关问题 我正在尝试使用javascript更改表单元格的属性,并且找到了我的建议,但似乎无法使它们正常工作 - I am trying to change the properties of a table cell with javascript and have found my suggestions but I can't seem to get them to work 使用CSS Transform使div变大,但似乎无法使其他div移动 - using CSS Transform to make div bigger, but can't seem to get other divs to move 当我在它们周围移动时,WebGL纹理会变形 - WebGL textures distort as I move around them eventDrop和drop full日历 - eventDrop and drop fullCalendar 我试图制作一个 discord 机器人,主要是为了好玩,但我似乎无法让我的 kick 命令中使用的 if else 语句正常工作 - Im trying to make a discord bot mostly just for fun but i cant seem to get the if else statements used in my kick command to work properly 如何在FullCalendar中使用外部元素获取drop和eventDrop的结束时间? - How to get end time on drop and eventDrop with external elements in FullCalendar? 我正在尝试使用 axios 表单数据将 js 数组发送到 php 但它一直失败 - im trying to send a js array to php using axios formdata but it keep on failing i get [objext object] at console and if im trying to use stringify "" 我正在尝试从 <select>列到顶部,但是我的代码似乎不起作用 - I'm trying to move one element from a <select> list to the top, but my code doesn't seem to work 设置间隔(); 不工作。 我正在尝试倒计时到 go,但它卡住了,我似乎找不到它有什么问题 - setInterval(); not working. I am trying to get my countdown to go down but it gets stuck and I can't seem to find whats wrong with it 似乎无法将细分移入重复字段 - Can't seem to move segment into repeating field
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM