@Component({
template: `
<div>
<ejs-grid id='Grid' [dataSource]='srcData'(rowDrag)='rowDrag($event)' (rowDrop)='rowDrop($event)' [allowRowDragAndDrop]="true"
[rowDropSettings]="srcDropOptions" [selectionSettings]="selectionOptions">
<e-columns>
. . . . . . . .
. . . . . . . .
</e-columns>
</ejs-grid>
</div>
<ejs-schedule #scheduleObj id='Schedule' [selectedDate]='selectedDate' [views]='views' [eventSettings]='eventSettings'></ejs-schedule>`
})
export class AppComponent {
public srcDropOptions = { targetID: 'Schedule' }; // you have to set the targetID to reach your destination from grid.
@ViewChild('scheduleObj')
public scheduleObj: ScheduleComponent;
rowDrop(args: any){
this.scheduleObj.addEvent(args.data);
args.cancel = false;
}
rowDrag(args: any) {
args.cancel = true;
}
} |