问题
I have a kendo Grid that I make changes to and this saves to database.
There is a button on the form that I submit additional information to a different database. I would like to check that the kendo grid has all changes saved when I click this button.
If there are still some outstanding changes(red arrow in kendo grid) the user will have to save changes before proceeding.
Can this be achieved with Javascript?
回答1:
In the past I was able to determine if there were unsaved changes by reading the dirty
flag from the datasource. I'm not sure if this is documented with Kendo at all, I just found it by chance poking around the datasource. Hopefully it will help you out.
For "myGrid":
var boolDirty = false;
$.each($("#myGrid").data("kendoGrid").dataSource._data, function () {
if (this.dirty) { boolDirty = true; }
});
来源:https://stackoverflow.com/questions/20959575/kendo-grid-save-changes