Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
4233 Tampilan

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

Avatar
Buang

Did you find any solution?

Jawaban Terbai

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
Buang
Penulis

Hello Ibrahim,

Thank you for answer. Let me try this.

Post Terkait Replies Tampilan Aktivitas
1
Feb 24
4971
1
Jan 24
1436
2
Nov 23
3347
1
Mei 23
5773
1
Nov 22
6627