I have a kendo ui treeview. I want to update or delete the node of the kendo treeview on double click event. When i double click on the treeview node it is getting to edit mode in the text box. Then i want to append a close button icon and when i click on that i want to remove the node and the related child nodes. I have defined the code like
var treeview = $("#treeview").kendoTreeView({
template: kendo.template($("#treeview-template").html()),
select: onSelect,
loadOnDemand: true,
dataSource: dataSource, // dynamic datasource
dataTextField: ["categoryname"]
}).on('dblclick', '.child', function(event)
{
$(this).siblings(".sri").show();
$target = $(event.target);
alert("event" + event);
$target.editable(function (value, settings)
{
return value;
},
{
event: 'dblclick',
cssclass: 'treeInlineEdit'
});
$target.trigger('dblclick', [event]);
}).data("kendoTreeView");
And my template is like
<script id="treeview-template" type="text/kendo-ui-template">
<span class='child'>#: item.categoryname #</span>
<a class='showcloseicon' onclick='sri(#:item.categoryid#)' name='#:item.categoryid#' style='color:blue;display:none'>X</a>
</script>
But the code is not properly working. What are the changes i need to do.