3

私のグループのプロジェクトでは、1つのグリッドとエクスポートボタンがありました。Excel形式のフィドルでデータを除外する場合、 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");  
4

1 に答える 1

3

DataSourceのイベント ハンドラを定義に追加します。requestStartrequestEnd

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();
},
于 2013-03-19T07:58:29.210 に答える