KendoUI之kendoGrid服務端分頁


parameterMap:設定傳遞給服務器的當前頁數與每頁大小,django下用get方法有效,post方法無法取得這2個參數
shema.total:設定總行數
serverPaging: true //設定服務器來實現分頁功能
var ds = new kendo.data.DataSource ({
    transport: {
        read: {
            url: 'xxx',
            type: 'GET',    //X GET
            dataType: 'json',
            contentType: 'application/json; charset=utf-8',
        }
        ,parameterMap: function (options, operation) {  //X
            if (operation == "read") {
                return {page:options.page,pageSize:options.pageSize};
            }
        }

    }
    ,schema: {
        total : function(d) {
            return {{task_counts}};
            //return 100000000000;   //總條數
        }
    }
    ,batch: true        //X    
    ,pageSize: 15       //X    
    ,serverPaging: true //X
});

window.dataBindingLoaded = false;
$("#grid").kendoGrid({
dataSource: ds,
//...

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM