Help with Total

3 posts, 1 answers
  1. Nathan
    Nathan avatar
    24 posts
    Member since:
    Sep 2009

    Posted 20 Jan 2014 Link to this post

    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. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 22 Jan 2014 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Answer
    Nathan
    Nathan avatar
    24 posts
    Member since:
    Sep 2009

    Posted 22 Jan 2014 Link to this post

    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!
Back to Top