How to bind JSON child array to Kendo grid

泪湿孤枕 提交于 2019-12-06 13:29:00

In the response, you have defined container as an array but not sure if it might repeat. As far as I understand the actual data is items. Correct? If so, this is the minimum DataSource definition.

var dataSource = new kendo.data.DataSource({
    transport: {
        read: {
            url     : "http://...",
            dataType: "json",
            data: {
                Accept: "application/json"
            }
        }
    },
    pageSize : 10,
    schema   : {
        data: "container[0].items"
    }
});

NOTE: The response that you show doesn't look like a JSONP but a JSON. That's why I'm setting dataType as JSON.

Take a look at the example here which has what I think you are looking for.

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