Is there a way to get the last value registered in the sizeChange event?

1 Answer 63 Views
General Discussions Splitter
Ryan
Top achievements
Rank 1
Ryan asked on 09 Mar 2022, 09:11 PM
Hello guys!
I'm trying to preserve the last width value in the splitter panel's resizer, but the sizeChange event is hitting my endpoint too many times because it's trying to store each of the values ​​that are between the start position and the end position. How can I avoid this? is there a way to get the last value registered in the sizeChange event?

1 Answer, 1 is accepted

Sort by
0
Yanmario
Telerik team
answered on 14 Mar 2022, 10:09 AM

Hi Joseph,

I've noticed that the same question was asked in the private ticket thread with id - 1557203. I will provide the answer from the ticked in the forum thread for public knowledge.

Copy of the answer:

The desired requirement can be achieved by attaching a click event to the "k-splitbar-draggable-horizontal" class that will allow the developer to know when the user released the mouse click and ended the sizeChange event. Please check the following example demonstrating the mentioned approach:

https://stackblitz.com/edit/angular-mgotaq-aesfmw?file=app/app.component.ts

Worth mentioning is that the added events must be removed on ngOnDestroy to avoid memory leaks.

If there are any additional questions, please choose one of the threads to continue the communication.

Regards,
Yanmario
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
General Discussions Splitter
Asked by
Ryan
Top achievements
Rank 1
Answers by
Yanmario
Telerik team
Share this question
or