Comments (10)
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.
@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.
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.
nah. that repository is 3 years old. definitely not working with recent full-calendar.
from fullcalendar-workspace.
as per the docs
eventReceive: function (event, view) {
var resourceId = event.resourceId;
...
}
from fullcalendar-workspace.
looks like the solution has been discovered
from fullcalendar-workspace.
@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.
ah, now i understand. i assumed this was for eventReceive
when it was actually an issue with drop
.
from fullcalendar-workspace.
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
.
from fullcalendar-workspace.
this has been released in scheduler v1.2.0
http://fullcalendar.io/docs/dropping/drop/
from fullcalendar-workspace.
Related Issues (20)
- Setting multiple start-end range business hours for each resource HOT 6
- Naming inconsistency for 'eventResourceEditable' flag HOT 4
- Loading events for the resource children depends on children id. HOT 1
- Link between events like project management tool HOT 1
- Events with no end time after 11pm have a one-hour duration HOT 2
- Week view and day view too messy if i have 1000 record a days HOT 1
- DON'T USE THIS ISSUE TRACKER
- This issue tracker has moved
- test
- test2 HOT 3
- Next / Previous button only shows 3 days not five HOT 1
- Is there any way to merge events with same titles or custom id's and same start/end dates? HOT 1
- How to get events by groupId? HOT 1
- Module not found in azure devops HOT 2
- BUG: Events breaking on resourceTimelineWeek view HOT 1
- @fullcalendar/resource-timeline 5.6.0 package broken while used with Vue Js HOT 1
- hide timeslot HOT 1
- adding filter by ressource HOT 1
- show one Event in a row (weekly View) HOT 1
- Event overlap on angular 13 and full calender 5.3/5.11 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fullcalendar-workspace.