4
這是無論如何要在劍道網格中添加/插入行,當有界數據源改變(插入/刪除/添加)如何在Kendo Grid中添加/插入行?
這是無論如何要在劍道網格中添加/插入行,當有界數據源改變(插入/刪除/添加)如何在Kendo Grid中添加/插入行?
Working Demo here click herehttp://jsfiddle.net/VMrqS/
或這http://jsfiddle.net/D3rSk/7/
我讀這個鏈接這個演示可以幫助你:希望這對你有用:http://www.kendoui.com/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"}
]
});
});