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

Grid only displaying first page of data

1 Answer 476 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Wayne
Top achievements
Rank 1
Wayne asked on 02 May 2013, 09:14 PM
I have the code below to bind data to my grid on the client.  The grid is bound to the data, but I am having trouble getting the paging working.  Here is my code"

$("#btnSearch").click(function () {           
            $.ajax({
                url: "/Booking/GetBookingLookupData",
                type: "POST",
                data: null,
                contentType: "application/json"
            }).success(function (data) {
                
                var d = data;
                var gdata = $("#grid").data("kendoGrid");

                var ds = new kendo.data.DataSource({

                    data: d,
                    pageSize: 10,                    
                    serverPaging: false

                });             
               
                ds.fetch(function () {    
                    ds.serverPaging = false;
                });               
                gdata.dataSource = ds;
                gdata.refresh();
               
            });

        });

All of the data gets bound to the datasource.  I see all of the rows if I do not make it pageable, but the paging is not working.  What am I missing?

Thanks,

Wayne

1 Answer, 1 is accepted

Sort by
0
Accepted
Wayne
Top achievements
Rank 1
answered on 02 May 2013, 10:07 PM
I guess I was overthinking this.  I solved the problem this way:

 $("#btnSearch").click(function () {
            $.ajax({
                url: "/Booking/GetBookingLookupData",
                type: "POST",
                data: null,
                contentType: "application/json"
            }).success(function (data) {                       
                $("#grid").data("kendoGrid").dataSource.data(data);                
            });

        });
Tags
Grid
Asked by
Wayne
Top achievements
Rank 1
Answers by
Wayne
Top achievements
Rank 1
Share this question
or