How to Scroll when dragging external from List to Schedule

Hi, 
I have problem with this

Regards.

3 Replies 1 reply marked as answer

HB Hareesh Balasubramanian Syncfusion Team June 4, 2021 12:13 PM UTC

Hi Minh, 

We have prepared a sample based on your shared query “need to scroll automatically when the schedular reached both extremes while external drag and drop” using nodeDragging event, which can be viewed from the following link. 


  onItemDrag(event) { 
    if (event.target.classList.contains('e-work-cells')) { 
      let contentArea = document 
        .querySelector('.e-content-wrap') 
        .getBoundingClientRect(); 
      let targetArea = event.target.getBoundingClientRect(); 
      let scroll = document.querySelector('.e-content-wrap').scrollLeft; 
      let scrollableWidth = document.querySelector('.e-content-table') 
        .offsetWidth; 
      let scrollRight = scroll + contentArea.width; 
      if (contentArea.left >= targetArea.left && scroll > 0) { 
        document.querySelector('.e-content-wrap').scrollLeft = scroll - 100; 
      } 
      if ( 
        contentArea.right <= targetArea.right && 
        scrollRight < scrollableWidth 
      ) { 
        document.querySelector('.e-content-wrap').scrollLeft = scroll + 100; 
      } 
    } 

Kindly try the above solution and get back to us if you need further assistance. 

Regards, 
Hareesh 


Marked as answer

MR mrmt June 4, 2021 01:50 PM UTC

Hi Hareesh,
It works for me,
Many thanks <3


NR Nevitha Ravi Syncfusion Team June 7, 2021 04:27 AM UTC

Hi Minh, 

You are most welcome..! please get back to us for further assistance. 

Regards, 
Nevitha 


Loader.
Up arrow icon