Hello,
I tried to create a TreeView with a custom ClientTemplate to instanciate an editor for each
Example (I just broke it down to the required settings):
01.
@(Html.Kendo().TreeView()
02.
.Name(
"treeview"
)
03.
.TemplateId(
"treeview-template"
)
04.
.Items(it1 =>
05.
{
06.
it1.Add().Id(
"1"
).Text(
"Test1"
)
07.
.Items(it2 =>
08.
{
09.
it2.Add().Id(
"2"
).Text(
"Test2"
);
10.
});
11.
})
12.
)
1.
<script id=
"treeview-template"
type=
"text/kendo-ui-template"
>
2.
@(Html.Kendo().Editor()
3.
.Name(
"editor_#=item.id#"
)
4.
.Value(
"#=item.text# #=item.id#"
)
5.
.ToClientTemplate())
6.
</script>
In the browser console I get the script error "Error: Invalid template: ...". As soon as I remove the #=item.id# in the .Name-function, it is working, but I have a name conflict with multiple instances (therefore I need the id inside the name). The same error occurs if I try .Name("editor_#=item.text#"). The value output of text and id is correct. Is this a bug in the editor widget or what am I doing wrong?