Reputation: 137
I want to remove all child of selected node like highlighted div in image.
Upvotes: 0
Views: 909
Reputation: 21465
Try this snippet:
var tv = $("#treeview").data("kendoTreeView");
$(tv.element).find('input[type="checkbox"]:checked').each((i, item) =>
{
$(item).closest("li").find("ul li").each((i, removeItem) => tv.remove(removeItem));
});
It finds all checked checkboxes and remove its children.
Upvotes: 1