在剑道格更改数据源 [英] Change datasource in Kendo grid

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

问题描述

我在 的jsfiddle Demo加入。这code完美的作品在谷歌浏览器(我没有与其他浏览器查询)。这意味着字段和数据源是完全取代。但是,当使用PhoneGap的转换作为Android应用和cordova.js它的工作原理是这样的演示(在这里,数据源是附加到previous之一)。我不知道会发生什么。

I have added demo in jsfiddle. This code works perfectly in google chrome (I didn't check with other browsers). Which means the field and datasource are perfectly replaced. But while convert it as android app using phonegap and cordova.js it works like this demo (Here the datasource is append to the previous one). I don't know what happens.

如果这个问题没有明确,请让我知道。

If this question didn't clear please let me know.

在此先感谢。

推荐答案

您应该使用剑道UI的当前版本,所以你可以使用摧毁方法,例如。
然后,您更改处理应该是这样的:

You should use a current version of Kendo UI so you can use the destroy method, for example. Your change handler should then look like this:

function changedata() {
    $("#grid").data("kendoGrid").destroy();
    $("#grid").empty();

    $("#grid").kendoGrid({
        dataSource: [{
            name: "Jane Doe",
            age: 30,
            no: 11
        }, {
            name: "John Doe",
            age: 33,
            no: 12
        }]
    });
}

演示

这篇关于在剑道格更改数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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