Hi guys...
I have a complex situation here.
I have a treeview loaded with remote data on server
(exactly the same of your example) and so I have an mvc anction with a nullable id that returns the child of the selected node.
Now in the normal scenario the tree starts with all node collapsed.
The problem is that I need to provide a way to load the page, and the tree as well, with a particular node loaded.
Here my tree:
I don't provide the action cause it is a bit complex and misleading since I get the data from 3 different tables...
anyway...It works perfectly...
now, I tried to pass the parameter to the actual treeview view (mcv) (success) and then pass it the to client (js)
I guess I need to open the node client-side...and sometimes the selected node could be up to the 9 level deep...
the problem is: if I pass the id (of the node) as an argument of the DataBound event, this event fires when the treeview is not rendered yet.
(while if I attach the event handler as you see on the code I provided, it fires when the rendering is compleated) that's weird...
so..How can I achieve what I need? there's no other event that fires "on Compleate", right?
Can I pass my parameter and have the event fire In the right moment?
I hope I made myself clear.
thanks
Fabio
I have a complex situation here.
I have a treeview loaded with remote data on server
(exactly the same of your example) and so I have an mvc anction with a nullable id that returns the child of the selected node.
Now in the normal scenario the tree starts with all node collapsed.
The problem is that I need to provide a way to load the page, and the tree as well, with a particular node loaded.
Here my tree:
@(Html.Kendo().TreeView()
.Name(
"DataSetTree"
)
.TemplateId(
"ClassifierTreeTemplate"
)
.DataSource(dataSource => dataSource
.Read(read => read
.Action(
"Index"
,
"DataSet"
).Type(HttpVerbs.Post)
)
)
.Events(e =>
{
e.Change(
"OnTreeChange"
);
e.DataBound(
"OnDataBound"
)
})
)
I don't provide the action cause it is a bit complex and misleading since I get the data from 3 different tables...
anyway...It works perfectly...
now, I tried to pass the parameter to the actual treeview view (mcv) (success) and then pass it the to client (js)
I guess I need to open the node client-side...and sometimes the selected node could be up to the 9 level deep...
the problem is: if I pass the id (of the node) as an argument of the DataBound event, this event fires when the treeview is not rendered yet.
(while if I attach the event handler as you see on the code I provided, it fires when the rendering is compleated) that's weird...
so..How can I achieve what I need? there's no other event that fires "on Compleate", right?
Can I pass my parameter and have the event fire In the right moment?
I hope I made myself clear.
thanks
Fabio