Skip to Content
Menu
This question has been flagged

I want to disable drag and drop functionality in calendar view specifically in odoo14.

Avatar
Discard

Did you find any solution?

Best Answer

Hi, 

Go to: odoo/addons/web/static/lib/fullcalendar/interaction/main.js

from line 1015, you will see this: 
dragging.emitter.on('pointerdown', this.handlePointerDown);
dragging.emitter.on('dragstart', this.handleDragStart);
dragging.emitter.on('dragmove', this.handleDragMove);
dragging.emitter.on('pointerup', this.handlePointerUp);
dragging.emitter.on('dragend', this.handleDragEnd);

put off instead of on for lines related to dragging, you will have this:

dragging.emitter.on('pointerdown', this.handlePointerDown);
dragging.emitter.on('dragstart', this.handleDragStart);
dragging.emitter.off('dragmove', this.handleDragMove);
dragging.emitter.on('pointerup', this.handlePointerUp);
dragging.emitter.on('dragend', this.handleDragEnd);

You will notice that Drag option isn't possible anymore in calendar view.
If you want to disable spreading out the record in calendar view, you will have to disable dragend too.


Hope this helps. 

Avatar
Discard
Author

Hello Ibrahim,

Thank you for answer. Let me try this.

Related Posts Replies Views Activity
1
Feb 24
3659
1
Jan 24
316
2
Nov 23
1972
1
May 23
3499
1
Nov 22
5112