I need to create a editable kendo grid - Batch eiditing , which adds/removes a row . Here i acheived it with kendo grid- batch editing as mentioned in the demo. My requirment is something like i need to initialize the grid with no data . But i was not able to do it & hence giving some sample data to initialise it. But i need the grid with an empty data but only with the header with options to add record. Also if i delete all the grid rows & try to add the first row then it is giving me error "Microsoft JScript runtime error: Unable to get value of the property 'id': object is null or undefined" , attaching the screenshot of the same.
Kindly help me out in resolving the creation of grid with no data .
Here goes my code :
var data = [
{
Company: "Spark Tech",
Country: "USA"
}
];
$j("#ComapnyDetailsGrid").kendoGrid({
dataSource: {
data: data,
batch: true,
pageSize: 30,
schema: {
model: {
fields: {
Company: { validation: { required: true} },
Country: { type: "string" }
}
}
}
},
editable: true,
toolbar: ["create", "save", "cancel"],
columns: [
{ field: "Company", title: "Company*" },
{ field: "Country", title: "Country" },
{
command: "destroy"
}
]
});
Thanks in advance.