Comments (16)
this has already been released
from react-big-calendar.
I thought I'd throw my two cents here... I had a branch going a few months ago with fully functional drag and drop, I just never got it cleaned up enough to make a PR.
Basically I was using the existing event cells, and on drag start, i would change the z-index of these cells so that they are "droppable". On drop we'd fire a callback to a user supplied prop function, with the new cells dates as parameters, and then set our z-index back to 0. The user can then update the event date in onEventDrop callback.
Take a look at what I did and see if this can help the effort.
https://github.com/mbahoshy/react-big-calendar/pull/1/files
from react-big-calendar.
@mbahoshy can you create a PR. Would be great to at least can this in so we can try it and improve if needed.
from react-big-calendar.
+1 yes drag and drop events would be a great feature!
from react-big-calendar.
+1
from react-big-calendar.
+1
from react-big-calendar.
I've forked this library (https://github.com/leesalminen/react-big-calendar) and have been working on Drag n Drop support using the react-dnd library (https://github.com/gaearon/react-dnd).
I'll submit a PR once all is working properly, but would appreciate any/all assistance!
I also have no idea how to approach resizing of an event. Would appreciate any assistance/guidance with that!
from react-big-calendar.
@leesalminen Nice! I've had some success as well integrating react-dnd with react-big-calendar. In my case, I made events draggable, as well as drop-targets, and I made day labels drop targets. With that, I could reschedule events to a different day (by dragging an event to a day label), and associate outside items with events (by dragging outside items onto events).
The way I approached it was to use customization points of react-big-calendar, and then add drag-and-drop support outside of the core library. For example, http://intljusticemission.github.io/react-big-calendar/examples/index.html#prop-components allows the event component to be customized. So I made a custom d&d event using react-dnd, and used that. I also made it possible to customize the day label component (srajko@2ee37d6 - I added another prop for it though really I should have built this on top of the existing components
prop), and then used a day label that was drop-target enabled.
This approach would work really nice if react-big-calendar:
- exposed default versions of its components
- allowed customization of more of its components via the
components
prop
That way d&d support could be added by just extending the default components with react-dnd attributes, and this could be done outside of core react-big-calendar (so someone else could implement different d&d functionality, or use a different d&d library)
Anyway - I would love to work with you on this, esp. if an approach like this sounds good to you (extending react-big-calendar to expose its default components and allow all of them to be customized, and then providing sample overrides that use react-dnd).
from react-big-calendar.
thanks for letting the effort here folks. I think I'd be great if this was doable as an extension point, then folks that don't need the behavior would have to include all of react-dnd. it also solves issues with the calendar it needing to know how to write to event objects to move the end and start dates, which is nice.
I'm happy to talk about adding any extension points needed to make it work, and maybe ultimately including it as an "official addon" or something
from react-big-calendar.
@leesalminen @jquense I started a work-in-progress PR (#84) that exposes the EventCell
component, and then extends it in an added drag&drop example. That much allows cells in the Month view to be dragged, though there is nothing to drop them on yet.
To make the example useful for moving around events, we'd need to expose components used to display events in other views, as well as background cells that could serve as drop targets.
from react-big-calendar.
@mbahoshy @jquense why dont thew merge?
from react-big-calendar.
+1
@mbahoshy Is the problem that the PR is many commits behind? I might be up to re-do your implementation from the current repo if that is the only problem.
from react-big-calendar.
dnd has been merged already :)
from react-big-calendar.
How can we use it? Is it this: https://github.com/intljusticemission/react-big-calendar/tree/master/src/addons/dragAndDrop ? The addons/
doesn't show up in node_modules/react-big-calendar/
, is the idea to add it in manually?
Thanks!
from react-big-calendar.
not pushed to a release yet
from react-big-calendar.
Is a push to a release planned? Thanks!
from react-big-calendar.
Related Issues (20)
- onSelectSlot not returning doubleClick slotInfo objects HOT 3
- Error in week view when I want to select a range of hours HOT 1
- Modifying Calendar Day selection default color HOT 1
- Tab navigation between events in Monthly calendar view
- Change Navigation Buttons and Today Placement for Improved Usability HOT 2
- Translating README.md in Italian for wider accessibility
- warning ..\..\package.json: No license field HOT 1
- Add Russian and Chinese cultures to Localization (accessibility)
- Add Japanese Language Support For Localization
- Bug: Drag and Drop not functioning properly and duplicating events HOT 2
- Bug: Drag and Drop Examples link is throwing an error HOT 1
- Clicking on Day Cell Creates Empty Events Without Event Name Input HOT 1
- DragAndDrop with custom components causes re-mount on each render HOT 1
- Enhance User Understanding with Persona Development
- swap resource and day header in week view. HOT 1
- Slack invite expired HOT 1
- react-big-calendar selection offset HOT 1
- Luxon localizer should use LLL to format month instead of MMM HOT 3
- Drag and Drop example code has issues when dropping to / from all-day events HOT 1
- Cant create custom event design for month view
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 react-big-calendar.