0

コード:

var dataSource = new kendo.data.DataSource({
transport: {
    read: {
        url: "http://search.twitter.com/search.json",
        dataType: "jsonp",
        data: {
            q: "kendoui"
        }
    }
},
schema: {
    data: "results",
    total: function(response) {
        return response.results.length;
    }
},
pageSize: 4

});

ここでは、クライアント側からページサイズ4を設定する必要があります

4

1 に答える 1

1
   public JsonResult GetSettings()
    {
        return Json(new { count = Service.GetSettings<UserSetting>(AuthenticatedUser) }, JsonRequestBehavior.AllowGet);
    }

  var settingsDataSource = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: '@Url.Action("GetSetting")',
                        dataType: "json",
                        type: "GET"
                    }
                },
                schema: {
                    parse: function (data) {
                        resultCount = data.count;
                        return data;
                    }
                },
                change: function () {
                    Grid();
                }
            });
           settingsDataSource.read();

            function Grid() {
                mainGridDataSource = new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: '@Url.Action("GetDetails")',
                            dataType: "json",
                            type: "POST",
                            contentType: "application/json; charset=utf-8"
                        },
                        parameterMap: function (options) {
                            return JSON.stringify({ filter: options, isPrimary: options.isPrimary });
                        }
                    },
                    schema: {

                        model: {
                            fields: {

                                Status: { type: "string" },
                                Name: { type: "string" }

                            }
                        },
                        data: function (data) {
                            return data.data;
                        },
                        total: function (data) {
                            return data.totalCount;
                        }
                    },
                    pageSize: resultCount,
                    serverFiltering: true,
                    serverPaging: true
                });
于 2012-06-29T18:53:24.837 に答える