Smart UI Components & Libraries – Grid, Scheduler, Gantt, Kanban for Angular, React, Next.js, Vue, Blazor, JavaScript › Forums › Scheduler › dropoverCell do not work
Tagged: DropOverCell event
- This topic has 3 replies, 3 voices, and was last updated 2 years, 9 months ago by
Steven Peterson.
-
AuthorPosts
-
February 27, 2023 at 9:12 am #104433
Andrea Durando
ParticipantHi all,
in the scheduler i tryed to use the dropoverCell event, but seems do not work, this event should be fired when i release a draggable item on a cell, is that right?
Do you have any example that can help me to resolve this issue?
scheduler.html
<div>
<div> <smart-scheduler #scheduler</div>
<div> id=”scheduler”</div>
<div> [view]=”view”</div>
<div> [views]=”[‘day’,’week’,’month’]”</div>
<div> [firstDayOfWeek]=”firstDayOfWeek”</div>
<div> [hideAllDay]=”true”</div>
<div> [colorScheme]=”[‘#D50000’, ‘#E67C73’, ‘#F4511E’, ‘#F6BF26’, ”]”</div>
<div> (onEditDialogOpening)=”openEditBooking($event)”</div>
<div> (onDateChange)=”changeDate($event)”</div>
<div> (onViewChange)=”viewChange($event)”</div>
<div> (onDropoverCell)=”onDropoverCell($event)”</div>
<div> /></div>
</div>
<div></div>
scheduler.ts
<div>
<div> onDropoverCell (event: CustomEvent): void {</div>
<div> const detail = event.detail,</div>
<div> target = detail.target;</div>
<div> // date = detail.date,</div>
<div> // allDay = detail.allDay;</div>
<div> console.log(target.toString())</div>
<div> // event handling code goes here.</div>
<div> }</div>
</div>
RegardsAndrea
February 28, 2023 at 3:33 pm #104444svetoslav_borislavov
ParticipantHi,
The event that you need to use is dragEnd. The dropoverCell is a special event that is added primarily for Blazor.
Just use dragEnd and everything will work.
https://stackblitz.com/edit/github-6gi9ff?file=src/app/app.component.tsBest Regards,
Svetoslav BorislavovSmart UI Team
https://www.htmlelements.com/March 1, 2023 at 9:45 am #104445Andrea Durando
ParticipantOk clear thank’s,
I there a way to avoid the Drop operation in dragEnd?
I try with a return false with a eventPreventDefault and a stopPropagation but nothing work
March 2, 2023 at 5:48 am #104451Steven Peterson
ParticipantHi,
Only the dragStart event is cancelable, the dragEnd cannot be canceled,
Here is a link for the docs about drag events:
https://www.htmlelements.com/docs/scheduler-event-drag-resize/#dragBest Regards,
Steven PetersonSmart UI Team
https://www.htmlelements.com/ -
AuthorPosts
- You must be logged in to reply to this topic.