I am trying to implement an inline editor inside each item of a TreeView widget.
TreeView initialization:
01.
@(Html.Kendo()
02.
.TreeView()
03.
.Name(
"treeview"
)
04.
.TemplateId(
"treeview-template"
)
05.
.Items(it1 =>
06.
{
07.
it1.Add().Id(
"1"
).Text(
"Test1"
)
08.
.Items(it2 =>
09.
{
10.
it2.Add().Id(
"2"
).Text(
"Test2"
);
11.
});
12.
})
13.
)
TreeView template:
1.
<script id=
"treeview-template"
type=
"text/kendo-ui-template"
>
2.
#var id = 'editor_' + item.id;#
3.
@(Html.Kendo()
4.
.Editor()
5.
.Name(
"#=id#"
)
6.
.Value(
"#=item.text#"
)
7.
.ToClientTemplate())
8.
</script>
But when I click on an item, the editor is not opening. The click just selects the TreeView item.
When I add a click listener in javascript to the editor instance and call "...date('kendoEditor').toolbar.show()",
I get the toolbar but no focus, and when I set the focus manually its always at the beginning of the text.
It seems that some events on the TreeView are preventing the inline edit event (i.e. the 'select' event of the TreeView?).
Another example: http://demos.telerik.com/aspnet-core/treeview/index add a "contenteditable=true" to any item and try to click it. The cursor appears for a second and then the item loses focus.
Do you think there is any possibility to get this working?