Kendo Grid Save Changes

懵懂的女人 提交于 2019-12-25 02:44:17

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!