I have an Ajax populated treeview....
I have a requirement to update some data hidden against each child item - in the template - when a action (triggered outside of the control) occurs.
The template, for completeness, looks like this ...
Now, I have code for the trigger and that works just fine.
I have code to update the hidden data. Again. No worries.
What I can't figure out is how to simply get at all of the child (and granchild, etc) nodes of the node that is selected when the trigger fires.
If I were trying to get at the children when the node was initially clicked, I kind of expected to be able to say something like...
But no such functionality seems to exist.
Does anyone have any suggestions how I might go about this?
@(Html.Kendo().TreeView()
.Name(
"fao"
)
.HtmlAttributes(
new
{@
class
=
"fixed-height"
})
.DataTextField(
"Text"
)
.TemplateId(
"treeview-item-template"
)
.DataSource(ds => ds
.Read(r => r
.Action(
"_ModuleData"
,
"Home"
)
)
.Model(m => m
.Children(
"Items"
)
.HasChildren(
"HasChildren"
)
)
)
)
I have a requirement to update some data hidden against each child item - in the template - when a action (triggered outside of the control) occurs.
The template, for completeness, looks like this ...
<script id=
"treeview-item-template"
type=
"text/kendo-ui-template"
>
#= item.Text #<input type='hidden' class='hidden-data' data-fal='#= item.Fal#' data-uid='#=item.uid#'/>
</script>
Now, I have code for the trigger and that works just fine.
I have code to update the hidden data. Again. No worries.
What I can't figure out is how to simply get at all of the child (and granchild, etc) nodes of the node that is selected when the trigger fires.
If I were trying to get at the children when the node was initially clicked, I kind of expected to be able to say something like...
function
doSomething(e)
{
for
(n=0; n<e.node.nodes.length; n++)
{
doSomethingElse(e.node.nodes[n]);
}
}
But no such functionality seems to exist.
Does anyone have any suggestions how I might go about this?