Reputation: 363
How do I go about loading the treeview with all the parents and children. Right now it loads only the Parents and then loads each child when you click.
@(Html.Kendo().TreeView()
.Name("refModelTreeView")
.DataTextField("Name")
.HighlightPath(true)
.DataSource(datasource => datasource
.Read(read => read
.Action("LoadTreeView", "ReferenceModel").Data("addData")
)
)
Upvotes: 0
Views: 1247
Reputation: 5872
Use the expand
method as shown in the TreeView API reference.
$(document).ready(function () {
var treeview = $("#refModelTreeView").data("kendoTreeView");
treeView.expand(".k-item");
});
Upvotes: 1