I am using kendo ui treelist component, and fetching data from a remote source. 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
[{"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
I have checked the schema definition, and I really can't find where goes wrong. Does anyone know why?