4

当有界数据源更改时(插入/删除/添加),这是无论如何都要在 Kendo Grid 中添加/插入行吗?

4

1 回答 1

6

工作演示在这里点击这里 http://jsfiddle.net/VMrqS/

或者这个http://jsfiddle.net/D3rSk/7/

我阅读了此演示的链接以帮助您:希望这对您有用:http ://www.kendoui.c​​om/documentation/ui-widgets/grid/walkthrough.aspx

这将显示添加新行或删除示例。

代码

                $(document).ready(function() {
                    $("#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,
                            serverPaging: true,
                            serverFiltering: true,
                            serverSorting: true
                        },
                        height: 250,
                        filterable: true,
                        sortable: true,
                        pageable: true,
                        columns: [{
                                field:"OrderID",
                                filterable: false
                            },
                            "Freight", {
                                field: "OrderDate",
                                format: "{0:MM/dd/yyyy}"
                            },
                            "ShipName",
                            "ShipCity",
                            { command: "destroy", title: " ", width: "110px"}
                           ]

                    });
                });
​
于 2012-05-24T06:38:55.023 回答