Hi,
I have a treeview and I want to bind hierarchical data.
Country
State
Offices in State
I want to make call to the controller and get the data based on the node that is being expanded. To get the right data I want send the parameter of the currently selected node (Id, level) so that I can get the appropriate data to expand.
@(Html.Kendo().TreeView()
.Name("exampleTreeView")
.LoadOnDemand(true)
.Checkboxes(checkboxes => checkboxes
.Name("checkbox")
.CheckChildren(true)
)
.Events(events => events
.Check("onCheck")
)
.DataTextField("Name")
.DataSource(dataSource => dataSource
.Model(model=>model.Id("Value").HasChildren("HasChildren"))
.Read(read => read.Action("GetData", "MyController"))
)
)
Right now I can get the first set of data from getdata method and bind it. want to expand a nde which will call the same action method with some additional data to get the right data.
I have two questions -
1. (How) can I attach or bind additional property (level which could be country,state or office)
2. How can I pass this value to the GetData Action to get the right data.