My solution requires us to add rows programatically. There is a complication in that the rows need to be added to a subgrid. Looks like it works but the data is now being saved. To test our problem, I have added a button which runs the function below on your grid-odata-crud example which I downloaded from github.
function AddRow() {
var productsGrid = $('#grid').data('kendoGrid');
var dataSource = productsGrid.dataSource;
dataSource.add({ ProductID: 10002, ProductName: 'A Johns Product 1', UnitPrice: 10.00, UnitsInStock: 5, Discontinued: false });
dataSource.sync();
console.log('Done');
}
Should the above work. No rows are added to the database using this technique although I can add rows in the usual manner via the 'Add new record' button.
Hope you can help.
function AddRow() {
var productsGrid = $('#grid').data('kendoGrid');
var dataSource = productsGrid.dataSource;
dataSource.add({ ProductID: 10002, ProductName: 'A Johns Product 1', UnitPrice: 10.00, UnitsInStock: 5, Discontinued: false });
dataSource.sync();
console.log('Done');
}
Should the above work. No rows are added to the database using this technique although I can add rows in the usual manner via the 'Add new record' button.
Hope you can help.