Domanda

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?

È stato utile?

Soluzione

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; }
});
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top