I have a grid, which shows a number of details, including a list of email addresses. This data comes from a stored proc. In my custom edit form, I show a grid with email addresses, which are loaded via AJAX ( from the table that stores them, one per row ). If I only edit this list, then the grid does not save anything.
I did read up on this, and found this code below.
This 'works' but, the dirty flag is ALWAYS false, so, no matter what, it saves. This means if the built in functionality does a save, it all gets saved twice. What is the *proper* way to force the grid to save changes after the edit dialog is changed ? I am hoping for something I can set, when the user changes the email list, which will never result in two 'save' calls to the server.
Thanks
e.container.data("kendoWindow").bind("close", function (a, b, c) {
// This actually sucks. We can't make it work nicely when we have our own UI, so we just need to force it to always save.
var uid = this.element.closest("[data-role=window]").data("uid");
var dataSource = $("#adminGrid").data("kendoGrid").dataSource
//get the model from the dataSource
var model = dataSource.getByUid(uid);
if (!model.dirty)
{
model.dirty = true;
dataSource.sync();
}
})