Giter Club home page Giter Club logo

Comments (10)

outofbounder avatar outofbounder commented on June 10, 2024

eventDrop: function (event, delta, revertFunc, jsEvent, ui, view) {}

Also check your syntax on event.resourceId Note the lowercase 'd' (I was stuck on this!).

var blockedEvent = {
id: event.id+'booked',
title: '-unavailable-',
start: moment(event.start).subtract(30, 'minutes'),
end: moment(event.end).add(30, 'minutes'),
allDay: false,
resourceId: linkedRoomId,
backgroundColor: 'red',
editable: false,
anyOtherValue: 'myValue', //you can specify other objects too
//rendering: 'background' // BUG
};

to reference other values use blockedEvent.anyOtherValue

from fullcalendar-workspace.

dingzj avatar dingzj commented on June 10, 2024

@outofbounder thanks for the info.

Actually, my question is different. For external event dropping to the calendar, you have to use http://fullcalendar.io/docs/dropping/drop/ drop(callback) , not the eventDrop callback.

I had found my ways to do it; the drop callback has first parameter as date, but can be changed to dropLocation which will contains date, resourceId, allDay.

allDay also need to be hacked, to properly have a true or false value.

I didn't change the sourcecode coffee file, but change in the generated js files. (Otherwise, I will show my changes here.)

from fullcalendar-workspace.

outofbounder avatar outofbounder commented on June 10, 2024

No problem, I've been working around a few things myself. Have you tried something like this?
drop: function(date, jsEvent, ui, res) { // this function is called when something is dropped

then using res.id https://github.com/bkaluza/fullcalendar/blob/master/demos/external-dragging-resource.html

from fullcalendar-workspace.

dingzj avatar dingzj commented on June 10, 2024

nah. that repository is 3 years old. definitely not working with recent full-calendar.

from fullcalendar-workspace.

trbngr avatar trbngr commented on June 10, 2024

as per the docs

eventReceive: function (event, view) {
  var resourceId = event.resourceId;
  ...
}

from fullcalendar-workspace.

arshaw avatar arshaw commented on June 10, 2024

looks like the solution has been discovered

from fullcalendar-workspace.

50bbx avatar 50bbx commented on June 10, 2024

@arshaw This is not closed. The eventReceive is a different callback. The drop callback is triggered when a valid jQuery UI object is dropped on the calendar/scheduler, NOT when an Event Object is dropped on the callendar. In the scheduler, the select callback has startDate, endDate, jsEvent, view, resource. The drop callback should have the resource too in he scheduler view, otherwise when I drop a jQuery UI object I cannot convert it into a valid fullcalendar Event Object.
In fact, because of the missing resource, I cannot tell where the element has been dropped

@dingzj How did you find the dropLocation callback? Doesn't seem to work for me.

from fullcalendar-workspace.

arshaw avatar arshaw commented on June 10, 2024

ah, now i understand. i assumed this was for eventReceive when it was actually an issue with drop.

from fullcalendar-workspace.

dingzj avatar dingzj commented on June 10, 2024

@50bbx

Here is my changes compare to the 2.4.0 version (of fullcalendar.js). The key part is last difference which use dropLocation, not dropLocation.start in the triggerExternalDrop function. Then the drop callback will be like drop : function dropEvent( dropLocation, jsEvent, ui, resource ) , you can easily get resource id by dropLocation.resourceId .

image

from fullcalendar-workspace.

arshaw avatar arshaw commented on June 10, 2024

this has been released in scheduler v1.2.0
http://fullcalendar.io/docs/dropping/drop/

from fullcalendar-workspace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.