在Kendo Grid中添加无效的记录计数

时间:2015-04-22 22:39:15

标签: javascript kendo-ui kendo-grid kendo-asp.net-mvc

我试图找到一个解决方案来计算Kendo Grid中的无效行并显示它的页脚。我尝试在Messages中添加一个显示属性,但它基本上修改了右侧页脚消息,例如" 1 - 6 of 6 items"封闭的屏幕截图。我是剑道中的新人。谁能建议我如何实现这一目标?以下是在DataTable.cshtml中初始化网格的方法

    function initializeDetails(e) {
        var detailRow = e.detailRow;

        var datatableDetailsDataSource = new kendo.data.DataSource({
            autoSync: true,
            batch: false,
            error: datatableDeletedErrorHandler,
            pageSize: 5,
            schema: {
                data: "Data",
                errors: "Error",
                model: {
                    "Id": "ID",
                    "RevisionDate": { "type": "date" },
                    "UserName": { "type": "string" },
                    "NewData": { "type": "string" }
                },
                total: "Total"
            },
            serverFiltering: true,
            serverPaging: true,
            serverSorting: true,
            sort: { field: "Audit_Date", dir: "desc" },
            transport: {
                parameterMap: function(options) {
                    options = refactorKendoDataSourceOptions(options);
                    return $.extend({}, options, {
                        ReportId: $("#reports").val(),
                        AdviserId: $("#advisers").val(),
                        FundId: $("#funds").val(),
                        RecordId: e.data.ID,
                        TableName: conceptSettings.tablename,
                        TimeZoneOffset: getTimeZoneOffset()
                    });
                },
                read: {
                    cache: false,
                    dataType: "json",
                    type: "GET",
                    url: "/RequestAction/ReadDetails"
                }
            },
            type: "json"
        });

        detailRow.find(".datatable_details").kendoGrid({
            altRowTemplate: kendo.template($("#datatableDetailsRowTemplateAlt").html()),
            autoBind: true,
            columns: @{ ViewContext.Writer.Write(JsonConvert.SerializeObject(datatableDetailsColumns)); },
            dataSource: datatableDetailsDataSource,
            pageable: {
                input: true,
                messages: { 
                    itemsPerPage: "    items per page",
                },
                pageSizes: [5, 10],
                refresh: true
            },
            resizable: true,
            rowTemplate: kendo.template($("#datatableDetailsRowTemplate").html()),
            scrollable: true,
            sortable: true
        });
    }

</script>

0 个答案:

没有答案