【发布时间】:2016-06-24 19:34:55
【问题描述】:
我很难找到准确描述在这种情况下该怎么做的任何文档。
我的DataSource 有以下架构:
schema: {
model: {
id: "Id",
fields: {
BuyerProfile: [
{
Id: { type: "number" },
Name: { type: "string" },
City: { type: "string" },
State: { type: "string" },
Description: { type: "string" },
BuyerType: [
{
Id: { type: "number" },
Name: { type: "string" }
}
]
}
]
}
}
}
我的 JSON 格式正确,我没有收到任何错误。但是,当我尝试在我的剑道模板中打印任何项目时,我只会打印出undefined。
例如:
<script type="text/x-kendo-tmpl" id="profileTemplate">
<p> #:BuyerProfile.Name# </p>
</script>
上面的例子实际上只是在p 标签内打印出undefined。没有 JavaScript 错误或任何东西。
我可能是错的,但我想我在某处读到这就是你如何在 Kendo 中使用嵌套的 JSON 对象。但是,显然不是,因为它不起作用或者我错过了一些东西。
【问题讨论】: