0

This is my code:

var dataSource = new kendo.data.DataSource({
    transport: {
        read: {
            url: getMembersUrl,
            dataType: "json",
            type: "get"
        }
    },
    serverPaging: true,
    pageSize: 2,
    schema: {
        data: "Data",
        total: "Total",
    }
});

When I call read on the datasource, it doesn't send the pagesize or take (I tried both) as part of the request. I am really scratching my head on this one.

TRiG
  • 10,148
  • 7
  • 57
  • 107
David
  • 710
  • 5
  • 15
  • 1
    There is no `take` property on the Kendo UI DataSource object. [Reference](http://docs.telerik.com/kendo-ui/api/framework/datasource). – Brett Jun 16 '14 at 15:59
  • 1
    Is the widget using this dataSource configured for paging? – Brett Jun 16 '14 at 16:07
  • I am using a grid and yes, it is. Even just using it by itself (calling read on the dataSource) doesn't send the pagesize. According to the documentation `take=pageSize` (and I tried both) – David Jun 16 '14 at 21:05
  • 1
    You haven't identified the `pageSize`. Please post the code you used to configure your grid. – Brett Jun 17 '14 at 13:18
  • In simplifying the code to post here, I removed "autoBind" in my grid - which fixed it. Thanks for bearing with me. – David Jun 17 '14 at 23:42

1 Answers1

0

Your code works fine and it sends take as expected. If you run:

var dataSource = new kendo.data.DataSource({
    transport: {
        read: {
            url: "fake",
            dataType: "json",
            type: "get"
        }
    },
    serverPaging: true,
    pageSize: 2,
    schema: {
        data: "Data",
        total: "Total",
    }
});

And define a button and a handler for triggering the read:

<button id="read" class="k-button">Read</button>

$("#read").on("click", function() {
    console.log("About to fetch data");
    dataSource.fetch();
});

As here : http://jsfiddle.net/OnaBai/34qe4oks/

You will see in the browser console that it actually sends the request:

enter image description here

If you don't see the request is very likely because you are not actually reading from the DataSource (remember that the Grid DataSource is read when the Grid finishes its initialization)

OnaBai
  • 40,767
  • 6
  • 96
  • 125