pageSize changed event

1 Answer 1933 Views
Data Source
Matjaz
Top achievements
Rank 1
Matjaz asked on 31 Jul 2014, 12:43 PM
I have listView bind to dataSource and pager also bind to the same dataSource. When I change pageSize I want to store new value, so the next time user load page I can set pageSize to his last choice.

I try dataSource change event, but it is not fired. There is also no events on pager.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 01 Aug 2014, 02:10 PM
Hello Matjaz,

There is no pageSizeChanged event, but you have other two options:

1. Use the databinding event of the ListView and check what is the page size.

https://docs.telerik.com/kendo-ui/api/javascript/ui/listview/events/databinding

function onDataBinding(e) {
   var pageSize = e.sender.dataSource.pageSize();
}

or

2. Use the change event of the PageSize dropdown in the pager.

http://docs.telerik.com/kendo-ui/api/web/dropdownlist#events-change

var pager = $("#pager").data("kendoPager");
var pageSizeDropDownList = pager.wrapper.children(".k-grid-pager").find("select").data("kendoDropDownList");
 
pageSizeDropDownList.bind("change", function(e) {
   var pageSize = e.sender.value();
});


Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Anya
Top achievements
Rank 1
commented on 27 Feb 2019, 02:10 AM

Is it possible to see this in a full example. I'm having trouble setting up the same custom event handler with dataBinding
Dimo
Telerik team
commented on 27 Feb 2019, 08:54 AM

Hello Anya,

Consider the following example, which demonstrates the first option from my previous reply. Let me know if you have additional questions.

https://dojo.telerik.com/uToNIKOF

Regards,
Dimo
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.
Tags
Data Source
Asked by
Matjaz
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or