我想知道您是否可以帮助我,几个小时以来,我一直在努力让我的rest JSON数据在kendo-grid中正确显示,并且刚刚弄清楚这是因为我的JSON上有额外的节点
$(function() {
var grid = $("#grid").kendoGrid({
dataSource: {
data: {
"ttPortalCommunicationResult": [{
"UniqueID": 7,
"DocumentTitle": "Expense Contribution Scheme Guide",
"ActivationDate": "2012-05-22",
"DeactivationDate": "2020-05-12",
"CategoryDesc": "Operational news"
}],
},
pageSize: 10,
schema: {
data: "ttPortalCommunicationResult"
}
}
}).data("kendoGrid");
});我得到一个错误的Cannot read property 'slice' of undefined。
我的问题是,如何在包含额外节点的JSON数据上仅使用"ttPortalCommunicationResult“节点?
我假设kendo会知道如何遍历到该节点。一个解释为什么它不能也是很好的。
发布于 2016-01-26 17:56:34
使用dataSource架构解析方法
schema: {
parse : function(data) {
return data.ttPortalCommunicationResult;
}
}https://stackoverflow.com/questions/35010058
复制相似问题