React-big-calendar: Turn off dragging for some events

Created on 19 Sep 2017  路  3Comments  路  Source: jquense/react-big-calendar

Hello,
is there any way how to stop dragging for some events in calendar?
I got some events in the past which I do not to want to move, so I need to turn off their drag event. Is it possible?

Thank you very much

Most helpful comment

Hello there,

Yes you can,

with the api: draggableAccessor

draggableAccessor={event => false}

https://github.com/intljusticemission/react-big-calendar/tree/master/src/addons/dragAndDrop

All 3 comments

D&D uses react-dnd, which i'm not super familar with (i don't really maintain the addon) but i'm sure there is a way to cancel events from it, if you poke around in the docs.

Hello there,
Could you uncomment this line https://github.com/intljusticemission/react-big-calendar/blob/master/src/addons/dragAndDrop/DraggableEventWrapper.js#L138 on next release ?

You then just need to add a key 'draggable: true/false' in your event object.

Hello there,

Yes you can,

with the api: draggableAccessor

draggableAccessor={event => false}

https://github.com/intljusticemission/react-big-calendar/tree/master/src/addons/dragAndDrop

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nicolasriccardi picture nicolasriccardi  路  3Comments

Hector26 picture Hector26  路  3Comments

jgautsch picture jgautsch  路  3Comments

zhming0 picture zhming0  路  3Comments

bionicvapourboy picture bionicvapourboy  路  3Comments