I'm trying to populate my treeview using the viewmodel:
VIEWMODEL:
var vm = {
dragAndDrop: ko.observable(true),
dataSource: getDataAPI(),
dataTextField: "FullName"
}
return vm;
function getDataAPI() {
var serviceRoot = "http://demos.kendoui.com/service";
var homogeneous = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: serviceRoot + "/Employees",
dataType: "jsonp"
}
},
schema: {
model: {
id: "EmployeeId",
hasChildren: "HasEmployees"
}
}
});
return homogeneous;
}
VIEW:
<div data-bind="kendoTreeView: { dragAndDrop: dragAndDrop, dataSource: dataSource }"></div>
ERROR:
Unable to get value of the property 'toLowerCase'
SUMMARY: I am able to populate a tree if I use static json data, using this knockout method