This is a migrated thread and some comments may be shown as answers.

Pager with MVVM

2 Answers 199 Views
ListView
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 08 Feb 2013, 06:13 AM
How do I set the page size on the listview for MVVM?  the source for the listview and pager is just an array on the model.

2 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 11 Feb 2013, 04:41 PM
Hi Steve,

Paging is feature of the DataSource. Generally speaking you can set it in this way:
data-source='{ "pageSize": 3 }'

However you will not be able to navigate between the pages out of the box. To do that you may hook up to the change event of the pager and manually switch its page.
onChange: function (e) {
    var listview = $("#listview").data("kendoListView");
    listview.dataSource.page(e.sender.page());
}

For your convenience I prepared a small example: http://jsbin.com/inafud/2/edit

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Muhammad
Top achievements
Rank 1
answered on 03 Dec 2014, 10:31 AM
if using mobile then please use 

 var listview = $("#listview").data("kendoMobileListView");
Tags
ListView
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Alexander Valchev
Telerik team
Muhammad
Top achievements
Rank 1
Share this question
or