Kendo网格保存更改 [英] Kendo Grid Save Changes

查看:110
本文介绍了Kendo网格保存更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Kendo Grid,可以对其进行更改并将其保存到数据库中.

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.

如果仍有一些未完成的更改(kendo网格中的红色箭头),则用户必须先保存更改,然后再继续.

If there are still some outstanding changes(red arrow in kendo grid) the user will have to save changes before proceeding.

这可以用Javascript实现吗?

Can this be achieved with Javascript?

推荐答案

过去,我可以通过从数据源读取dirty标志来确定是否存在未保存的更改.我不确定这是否与Kendo一起记录了,我只是偶然地在数据源中摸索发现了它.希望它将对您有所帮助.

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.

对于"myGrid":

For "myGrid":

var boolDirty = false;

$.each($("#myGrid").data("kendoGrid").dataSource._data, function () {
    if (this.dirty) { boolDirty = true; }
});

这篇关于Kendo网格保存更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆