如何检查Kendo Grid是否已对其进行了更改? [英] How do I check if a Kendo Grid has had changes made to it?

查看:77
本文介绍了如何检查Kendo Grid是否已对其进行了更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查 Kendo网格是否已更改?我听说有一个dirty属性,但是找不到.

How can I check if a Kendo Grid has changes? I heard that there is a dirty property, but I cant find it.

推荐答案

添加的行会将dirty属性设置为true,因此更新的行也将设置为true.但是,已删除的行存储在其他位置(在_destroyed集合中).将此功能传递给网格的数据源,以查看其是否已更改.

Added rows will have the dirty property set to true and so will updated rows. But, deleted rows are stored elsewhere (in the _destroyed collection). Pass this function the datasource of your grid to see if it has changes.

function doesDataSourceHaveChanges(ds)
{
    var dirty = false;

    $.each(ds._data, function ()
    {
        if (this.dirty == true)
        {
            dirty = true;
        }
    });

    if (ds._destroyed.length > 0) dirty = true;

    return dirty;
}

这篇关于如何检查Kendo Grid是否已对其进行了更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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