How to add / insert a row into a Kendo grid?

This way or another, to add / insert a row in the Kendo grid when the restricted data source has been changed (insert / remove / add)

+4
source share
1 answer

A working demo here click here http://jsfiddle.net/VMrqS/

or this http://jsfiddle.net/D3rSk/7/

I read this link for this demo to help you: hope this comes in handy: http://www.kendoui.com/documentation/ui-widgets/grid/walkthrough.aspx

This will show an example of adding a new line or deleting.

the code

$(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"} ] }); }); ​ 
+6
source

Source: https://habr.com/ru/post/1414076/


All Articles