Kendo UI TreeView DragEnd event crashes extremely laggy-Collection of common programming errors
I’m trying to detect when I have dropped an item in a treeview after dragging it. When I do, it just hangs indefinitely searching for the javascript function. Sometimes it finds it after 10 seconds and sometimes it doesn’t. I’ve verified with Firebug that the function is always loading (and is only loading once).
My Kendo UI version is: 2012.2.913
Thanks in advance for any help or advice.
@(Html.Kendo().TreeView()
.Name("CompanyHierarchy")
.Events(events => events
.DragEnd("HierarchyDragEnd")
)
.BindTo(Model.Hierarchy as System.Collections.IEnumerable, mappings =>
{
mappings.For(binding => binding
.Children(c => c.Children)
.ItemDataBound((item, c) =>
{
item.Text = c.Name;
})
);
})
.DragAndDrop(true))
function HierarchyDragEnd(e) {
alert("here");
}
I don’t know if it will help but here’s a picture of it when it’s ‘frozen’
-
It seems that there is a bug with Firefox (in Chrome your example works fine) for the dragend event. A workaround is to delay the result in order to let the dragend event being registered correctly like this :
function HierarchyDragEnd(e) { setTimeout(function() { alert('here'); }, 100); }