When adding a new record the user is presented with a modal containing a form to fill out. When clicking OK, the data is saved to the DB and the modal closes. However I now have to add this record to the grid. I can't just refresh the grid from the DB since it could wipe out other changes the user might have made in the grid.
I need to get the data from the various form fields and pass it to the grid as a new row in javascript. I've seen an example where a row was copied from one kendo grid to another, but I can't find anything where a new record is added from scratch client side to a kendo grid. Here's the example copying from one grid to another: how to add a new row with pre defined data in kendo grid?
Basically what I'm trying to do is something like this:
var newRow = {field1: $("#field1").val(), field2: $("#field2").val(), field3: $("#field3").val()};
var grid = $("#grid").data("kendoGrid");
grid.addRow(newRow);