Get the position (xy) of the view before re-rendering the scheduler.

Hello,

in my project I bind the data for the appointments after they have been adjusted / checked by the backend. This is done with self created functions. The binding of the new data I achieve with:
 
this.scheduleObj.appendTo('#Schedule');

Everything works fine and the data is bound correctly. My problem is now only after this call the scheduler is re-rendered. This will put my position in the middle of the scheduler. But I would like to set the position to the place I had before the re-rendering. How can I achieve this behavior?

Regards,
Adrien

5 Replies

BS Balasubramanian Sattanathan Syncfusion Team December 9, 2020 12:04 PM UTC

Hi Adrien, 

Greetings from Syncfusion Support. 

We have validated your requirement at our end and prepared a sample based on that by making use of the scrollTo method like below. 

button.element.onclick = (): void => { 
  scheduleObj.refresh(); 
  // You can pass the specific time to the scrollTo method to scroll the schedule 
  scheduleObj.scrollTo("12:00"); 
}; 


Kindly try the above solution and let us know if you need further assistance. 

Regards, 
Balasubramanian S 



AP Adrien Pech December 9, 2020 12:56 PM UTC

Hello,

thank you for the quick response. I am very sorry I did not provide enough information. I use the timeline views, with two different resources (room and floor). I know the functions scrollTo() and scrollToResource(). Unfortunately I don't know where to get the positions before re-rendering the scheduler. So I don't know at which time and to which resource I should scroll. Is there any property, function ... where you can get this information?

Regards,
Adrien


BS Balasubramanian Sattanathan Syncfusion Team December 10, 2020 07:39 AM UTC

Hi Adrien, 

Thanks for the details. 

We have analyzed your requirement at our end and prepared a sample with the solution by using the below code snippet. 

button.element.onclick = (): void => { 
  // get scroll left position in px 
  scrollLeft = document.querySelector('.e-schedule-table .e-content-wrap').scrollLeft; 
  flag = true; 
  scheduleObj.refresh(); 
}; 
 
dataBound: () => { 
  if (flag) { 
    document.querySelector('.e-schedule-table .e-content-wrap').scrollLeft = scrollLeft; 
  } 
} 
 

Kindly try and refer to the above sample, let us know if this is helpful. 

Regards, 
Balasubramanian S 



AP Adrien Pech December 11, 2020 10:23 AM UTC

Hi,

thanks this was exactly what I was looking for and it works as requested!

Regards,
Adrien


NR Nevitha Ravi Syncfusion Team December 14, 2020 04:59 AM UTC

Hi Adrien, 

You are most welcome…! We are glad that our provided solution meets your requirement. Please get back to us if you need further assistance. 

Regards, 
Nevitha 


Loader.
Up arrow icon