【发布时间】:2016-06-11 13:19:02
【问题描述】:
我对剑道的东西有点了解,因此我正在寻求你的帮助。 我正在尝试使用 xml 数据显示剑道网格。但是网格的行显示为空。我正在尝试从 url(http://demos.kendoui.com/service/Northwind.svc/Products) 获取数据并在 kendo 小部件上设置数据源。一旦我运行示例 (http://jsfiddle.net/visibleinvisibly/c3qsdjq0/19/) 它显示空网格。我相信这种情况正在发生,因为我无法在数据源的“模式”对象中设置“数据”属性。我不想在这个示例中使用 json
以下是示例 Xml 数据
<feed xml:base="http://demos.telerik.com/kendo-ui/service/Northwind.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
.............................
...........................
<entry>
..................
....................
<content type="application/xml">
<m:properties>
<d:ProductID m:type="Edm.Int32">1</d:ProductID>
<d:ProductName>Chai</d:ProductName>
<d:UnitPrice m:type="Edm.Decimal">18.00</d:UnitPrice>
</m:properties>
</content>
</entry>
</feed>
schema中的data属性是这样设置的
schema: {
type: "xml",
data: "/feed/entry/content/properties",
model: {
fields: {
ProductID: "ProductID/text()",
ProductName: "ProductName/text()",
UnitPrice: "UnitPrice/text()"
}
}
}
提前致谢,
亚历克斯。
【问题讨论】:
标签: xml kendo-ui kendo-grid