kendoui grid razor使用restful urls绑定数据源

时间:2013-09-16 09:21:16

标签: jquery kendo-grid

我在当前项目中使用kendoUI网格进行CRUD操作。我正在尝试使用restful urls访问数据。

我可以使用以下脚本检索数据。

$("#grid").kendoGrid({
                data: {
                    Accept: "application/json"
                },
                dataSource: {
                    transport: {
                        read: {
                            url: `restful service url`
                        },
                        dataType: "jsonp",
                        parameterMap: function (options, operation) {
                            //debugger;
                            if (operation !== "read" && options.models) {
                                //debugger;
                                return { models: kendo.stringify(options.models) };
                            }
                        }
                    },
                    schema: {
                        model: {
                            fields: {
                                XXXId: { type: "number" }                               
                            }
                        }
                    },
                    pageSize: 10,
                    serverPaging: false,
                    serverFiltering: false,
                    serverSorting: false
                },
                height: 430,
                width: 900,
                sortable: true,               
                columnMenu: true,
                pageable: true,
                toolbar: ["create"],
                editable: "inline",
                columns: [{
                    field: "ControlGroupId",
                    title: "ControlGroup ID",
                    width: 100},               

                { command: ["edit", "destroy"], title: " ", width: "172px" }]
            });

任何人都可以帮我在razor方面做同样的事情..(称为宁静的服务)? 谢谢

0 个答案:

没有答案
相关问题