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

Return total results when server-side paging

1 Answer 1173 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Gabriel
Top achievements
Rank 1
Gabriel asked on 12 Jan 2012, 05:24 AM
If I'm getting data from a webservice and returning 10 at a time using server-paging, say there are 500 results, how do I return this so the datasource knows how many total pages there is?

Using Fiddler, it looks like: http://demos.kendoui.com/web/grid/remote-data.html has __count=830 under the key 'd'.

I'm not returning data like that but a simple JSON array. How would I go about it?

1 Answer, 1 is accepted

Sort by
0
Accepted
Nikolay Rusev
Telerik team
answered on 12 Jan 2012, 09:04 AM
Hello Gabriel,

Except the actual data you must return and the total count of the items, otherwise the pager will not be able to show correct pages.

For example see bellow:
http://jsfiddle.net/rusev/Lnkug/

Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Gabriel
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or