It there a way to sroll a listbox to the bottom programmatically? I just want to scroll the box to the bottom, without selecting any element on the list.
2 Answers, 1 is accepted
0
Tsvetomir
Telerik team
answered on 27 Dec 2019, 11:29 AM
Hi Timo,
The Kendo UI ListBox widget is compiled down to simple HTML. Therefore, you could access the height of the list holding the items and programmatically scroll down the parent element of this list. Here is an example:
var height = $(".k-listbox ul.k-list:eq(0)").height();
$(".k-listbox ul.k-list:eq(0)").closest(".k-list-scroller").scrollTop(height);
I hope you find this helpful.
Regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.
answered on 31 Aug 2023, 09:32 AM
| edited on 31 Aug 2023, 09:34 AM
Hi below snippet from one of my active project and i was struggling to get this done as well. finally managed to sort it out. below script works perfectly.
var objlistbox = $("#listboxone").data("kendoListBox");
//Scroll to last item in the list
let uid = objlistbox .dataItems()[12].uid;
let item = objlistbox .wrapper.find("[data-uid='" + uid+ "']");