[英]Kendo ui: Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
I am using kendo ui treelist component, and fetching data from a remote source.我正在使用 kendo ui 树列表组件,并从远程源获取数据。 The data source definition is :
数据源定义是:
$("#location-manage-grid").kendoTreeList({
dataSource: new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "api/getLocation",
dataType: "json"
}
},
schema: {
model: {
id: "id",
location: "location",
hierarchy: "hierarchy",
hasChildren: "hasChildren",
map: "map"
}
}
}),
height: 600,
pageable: true,
columns: [
{ field: "hierarchy", title: "Hierarchy", width: 250 },
{ field: "location", title: "location", width: 250 },
{ field: "map", title: "map", width: 250 },
{ title: "Edit", command: [ "edit", "destroy" ], width: 250, attributes: { style: "text-align: center;" } }
]
});
The response of the datasource url is数据源 url 的响应是
[{"hasChildren":true,"hierarchy":"Kendo ui","location":"New York","id":1,"map":true}]
However, when I run the application, it has an error, which said:但是,当我运行应用程序时,它有一个错误,它说:
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
未捕获的类型错误:无法读取未定义的属性“toLowerCase”
I have checked the schema definition, and I really can't find where goes wrong.我检查了模式定义,我真的找不到哪里出了问题。 Does anyone know why?
有谁知道为什么?
我发现我TreeListDataSource
误,我应该使用TreeListDataSource
而不是HierarchicalDataSource
,这是主要原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.