DayPilot.Scheduler.makeDraggable Not supported in Angular2?
Asked by Dave T.9 years ago.
Hi
It appears that allowing external drag and drop is not supported in the Angular2 version of DayPilot? Is there any plan to support this?
Dave
Comment posted by Dan Letecky [DayPilot]9 years ago.
The external drag and drop is not supported in the Angular 2 version yet. It will be implemented soon.
Comment posted by Stéphane Jourdois9 years ago.
Hi,
I would like to create a Angular2 Directive to solve this one (using trial daypilot-pro-angular@8.3.2573).
Why isn't at least makeDraggable() a property of DayPilot.Schedule (i.e. schedule1.control) object ?
I should be able to call DayPilot.Scheduler methods according to :
https://api.daypilot.org/daypilot-scheduler-makedraggable/
and https://doc.daypilot.org/scheduler/angular-2/
Stéphane
Comment posted by Stéphane Jourdois9 years ago.
Seems that build 8.3.2617 includes this function now. I'll post my directive example here as soon as it works.
Answer posted by Stéphane Jourdois9 years ago.
and here it is:
import { Directive, ElementRef, Input, AfterViewInit } from '@angular/core';
import { DayPilot } from 'daypilot-pro-angular';
@Directive({ selector: '[makeDraggable]' })
export class ScheduleMakeDraggableDirective implements AfterViewInit {
@Input('makeDraggable') options: any;
constructor(private el: ElementRef) { }
ngAfterViewInit(): void {
this.options.element = this.el.nativeElement;
DayPilot.Scheduler['makeDraggable'](this.options);
}
}
example usage in template :
<div [makeDraggable]="{ text: 'foobar', duration: 3600*24, id: 42 }">Draggable Event</div>
This question is more than 1 month old and has been closed. Please create a new question if you have anything to add.