We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Drag&Drop

Thread ID:

Created:

Updated:

Platform:

Replies:

147288 Sep 5,2019 10:18 AM UTC Sep 11,2019 08:36 AM UTC Angular - EJ 2 3
loading
Tags: Schedule
Unknown
Asked On September 5, 2019 10:18 AM UTC

Hello!
How to drag&drop from my own custom component to the scheduler?
I have a list (i.e. regular HTML divs) and I need to make an event by dragging elements onto scheduler. I've tried to make use of CDK Drag&Drop API  and Draggable/Droppable from syncfusion base, but I had no luck in both cases.
Do you have an example how I can achieve it? Is it possible at all?

Vengatesh Maniraj [Syncfusion]
Replied On September 6, 2019 03:15 PM UTC

Hi Artem, 
 
Syncfusion Greetings. 
 
Kindly check the below sample which illustrates how to drag and drop from external into Schedule. In this sample we can drag and drop the items from TreeView  component into Schedule. 
 

Kindly revert us if you have any further assistance. 

Regards, 
Vengatesh 


Unknown
Replied On September 9, 2019 09:05 AM UTC

Hello, thank you for reply!
I saw that example, unfortunately I can not use it. 
My external events are not in TreeView component, they are regular HTML divs so that they don't have any events like nodeDragStop or nodeDragging.
I would appreciate an example of the external dragging using regular HTML as a source of events.

Karthigeyan Krishnamurthi [Syncfusion]
Replied On September 11, 2019 08:36 AM UTC

Hi Artem, 
 
Thanks for the update. 
 
We have prepared the sample as per requirement, kindly refer the below links. 
 
ngAfterViewInit() { 
        let draggable: Draggable = new Draggable(document.getElementById('draggable'), {clone: false}); 
        let droppable: Droppable = new Droppable(document.getElementById('droppable'), { 
            drop: (e: DropEventArgs) => { 
              var obj = ((document.getElementsByClassName('e-schedule'))[0] as any).ej2_instances[1]; 
              let data = obj.getCellDetails(e.target); 
              let Appointment = { Subject: "New Event", StartTime: data.startTime, EndTime: data.endTime,IsAllDay: data.isAllDay}; 
              obj.openEditor(Appointment, 'Add', true); 
              document.querySelector('#draggable').remove() 
            } 
        }); 
    } 
 
Regards, 
Karthi 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon