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

Help with Total

2 Answers 15 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Nathan
Top achievements
Rank 2
Nathan asked on 20 Jan 2014, 06:17 PM
Hi,

I'm using a customized data source (no transport) with server side paging, and I can't seem to override the total on the datasource. It always seems to be set to the length of the data (the page size). Everything else is working fine but I removed the filtering and sorting to simplify this example.

Here's a js bin that shows my issue: (edit - fixed link)
http://jsbin.com/obuGeHE/2/edit

I expected the total showing on the grid to be twenty and for the grid to show 4 pages (even though in this simplified example I would always return the same 5 rows).

Can someone help me with what I'm missing?

Thanks in advance!

Nathan

2 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 22 Jan 2014, 09:26 AM
Hello Nathan,

The total() method gets the total number of data items. It does not set the total of the dataSource, as it is explained in our documentation. Using server operations without actually using transport and server connection is not supported in general, so some incorrect behavior is expected.

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Accepted
Nathan
Top achievements
Rank 2
answered on 22 Jan 2014, 03:36 PM
Thanks to Peter for the solution!

His example is here and uses the transport element and schema to specify the total. I didn't think of overriding the read method like this.

http://jsbin.com/OmIwANO/2/edit

Thanks again for the great support!
Tags
Data Source
Asked by
Nathan
Top achievements
Rank 2
Answers by
Kiril Nikolov
Telerik team
Nathan
Top achievements
Rank 2
Share this question
or