I was attempting to use this code
How can i remove the expand arrow in kendo ui treeview if there are no child's to display
Now, it is not the selected answer, but it is partially working for me
Here is the answer I based my hasChildren on
var inline = new kendo.data.HierarchicalDataSource({
data: @Html.Raw(dataSource),
schema: {
model: {
children: "Children",
hasChildren: function(e) {
var test = e.Children.length;
return test > 0;
}
}
}
});
My code looks like this:
children: "items",
//hasChildren: "Id" // Id I was using as that is a key
hasChildren: function(e) {
var test = e.items.length;
return test > 0;
}
- The load of the data looks great. All collapsed and I see that ONLY the parent nodes WITH children have Arrow icons . Perfect
Problem, as soon as I click to expand any Parent Node I get an error
Uncaught TypeError: Cannot read property 'length' of undefined
Why is this happening?