Kendo Datasource新数据同步

时间:2013-06-14 12:11:48

标签: kendo-ui datasource kendo-grid

我可以检查同步中的新数据是什么吗?

我有这个:

$('#order_it').click(function(){
    gridNewData.sync(); // this will send data to server
});

gridNewData完成:

complete: function(xhr, textStatus) {
    if (textStatus == 'success') {
        orders.read(); // this will refresh orders, and grid too, a
        gridNewData.data([]); // empty that temp datasource
    }
}

var orders = new kendo.data.DataSource({
    autoSync: false,
    transport: {
        read: {
            contentType: 'application/json',
            url: '/dokument/orders/',
            dataType: 'json',
            complete: function(xhr, textStatus) {

                // i think that here i need to get new synced items(or uids)

            }
        }
    },
    schema: {
        model: {
            id: 'id'
        }
    }
});

我需要使用其他颜色在网格中创建这些行,但无法找到检查新数据的方法。

1 个答案:

答案 0 :(得分:0)

你不会得到新的uid既不是物品。您可以做的是在调用sync()并搜索“isdirty”之前迭代数据集合。