2017-06-12 43 views
2

如何在Kendo設置pageSizegriddataSoure。我已經嘗試了下面的代碼,但它不工作。如何設置Kendo柵格數據源頁面大小編程

grid.dataSource.data(result).dataSource.pageSize(5); 

function loadCentres(e) { 
    arrCentreId = new Array(); 
    arrCentreIdRemove = new Array(); 
    $.ajax({ 
     type: 'GET', 
     url: '@Url.Action("GetCentres", "AAMaintenance")', 
     dataType: 'json', 
     data: { examinerId: hdnexaminerId }, 
     success: function (result) { 
      var grid = $("#Centres").data("kendoGrid"); 
      grid.dataSource.data(result).dataSource.pageSize(5); 
     } 
    }); 
} 

回答

2

你正在做的一切都很好。但是,你缺少的一行代碼:

grid.refresh(); 

這樣電網將採用新的DataSource配置

呈現