kendo-ui - 在过滤过程中显示弹出 View

标签 kendo-ui kendo-grid

在我小组的项目中,我们只有一个网格和导出按钮。我们遇到了一个问题,即当以 excel 格式 fiddle 提取数据时:http://jsfiddle.net/SZBrt/11/需要显示弹出消息,说明“正在过滤数据”,以便我们可以知道过滤正在进行中。提前感谢您的帮助。

还有我的代码:

      var grid = $("#grid").kendoGrid({
        dataSource: {
            type           : "odata",
            transport      : {
                read: "http://demos.kendoui.com/service/Northwind.svc/Orders"
            },
            schema         : {
                model: {
                    fields: {
                        OrderID  : { type: "number" },
                        Freight  : { type: "number" },
                        ShipName : { type: "string" },
                        OrderDate: { type: "date" },
                        ShipCity : { type: "string" }
                    }
                }
            },
            pageSize       : 10
        },
        filterable: true,
        sortable  : true,
        pageable  : true,
        columns   : [
            {
                field     : "OrderID",
                filterable: false
            },
            "Freight",
            {
                field : "OrderDate",
                title : "Order Date",
                width : 100,
                format: "{0:MM/dd/yyyy}"
            },
            {
                field: "ShipName",
                title: "Ship Name",
                width: 200
            },
            {
                field: "ShipCity",
                title: "Ship City"
            }
        ]
    }).data("kendoGrid");  

最佳答案

requestStartrequestEnd 添加到 DataSource 定义的事件处理程序。

dataSource: {
    requestStart : function() {
        // Add code for displaying your own "loading" message
    },
    requestEnd:    function() {
        // Add code for hiding your own "loading" message
    },
    type           : "odata",
            transport      : {
        read: "http://demos.kendoui.com/service/Northwind.svc/Orders"
    },
    schema         : {
        model: {
            fields: {
                OrderID  : { type: "number" },
                Freight  : { type: "number" },
                ShipName : { type: "string" },
                OrderDate: { type: "date" },
                ShipCity : { type: "string" }
            }
        }
    },
    pageSize       : 10
},

您没有指定 Loading 消息的外观,它可能就像添加/删除可见性一样简单:

requestStart: function () {
    $("#loading-msg").css("visibility", "visible");
},
requestEnd: function () {
    $("#loading-msg").css("visibility", "hidden");
},

或打开/关闭一个窗口:

requestStart: function () {
    $("#loading-msg").data("kendoWindow").center().open();
},
requestEnd: function () {
    $("#loading-msg").data("kendoWindow").close();
},

关于kendo-ui - 在过滤过程中显示弹出 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15492267/

相关文章:

c# - 如何将 Kendo UI Grid 与 ToDataSourceResult()、IQueryable<T>、ViewModel 和 AutoMapper 一起使用?

javascript - 记住 Kendo-UI 中刷新时扩展的细节网格

javascript - 在 JavaScript 中对网格数据进行排序。排序函数出错

javascript - Kendo UI 网格自定义过滤器 UI

javascript - 如果满足条件,则使 Kendo Grid 中的单元格只读

javascript - Kendo 自动完成 Jquery 插件错误

javascript - KendoUI 网格时间未正确排序

jquery - 在kendo ui网格中添加详细项目

asp.net-mvc-4 - 如何将 kendo ui mvc 网格绑定(bind)到对象列表

jquery - 更改 Kendo UI 网格层次结构的宽度?