kendo grid Serverpaging not working

1 posts, 0 answers
  1. tharani
    tharani avatar
    2 posts
    Member since:
    Mar 2014

    Posted 02 May 2014 Link to this post

    this is kendo grid code i want to load only 2  data in page 1 in kendo grid after while clicking to page 2 again another ie(next 2 data) want to load in grid this is because of increase loading speed.. i have no idea how to do it..pls anybody help me.....this is my code..    





        <script>
          var url = 'my service url here';

          var griddatasource = new kendo.data.DataSource({
            transport: {
              read: function (option) {

                $.ajax({
                  url: url + '',
                  dataType: 'json',       
                  success: function (result) {
                    option.success(JSON.parse(result.d));
                    alert(result.d);        
                  },
                  error: function (result) {
                    alert("error");

                  }
                });
              }
            },

            serverFiltering: true,
            serverSorting: true,
            serverPaging: true,
            pageSize: 2,
            schema: {
              data: "data",
              total: "total",
            }

          });

          function grid() {
            $("#grid").kendoGrid({
              dataSource: griddatasource,
              groupable: true,
              //sortable: {
              //    mode: "multiple",
              //    allowUnsort: true
              //},
              sortable: true,
              selectable: true,
              filterable: true,
              reorderable: true,
              resizable: true,
              columnMenu: true,
              pageable: {
                refresh: true,
                pageSizes: true,
                buttonCount: 5
              }
            });
          }
          $(document).ready(function () {
            grid();
          });
Back to Top