{"id":2498,"date":"2022-08-30T15:25:22","date_gmt":"2022-08-30T15:25:22","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/27\/kendo-ui-treeview-dragend-event-crashes-extremely-laggy-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:25:22","modified_gmt":"2022-08-30T15:25:22","slug":"kendo-ui-treeview-dragend-event-crashes-extremely-laggy-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/kendo-ui-treeview-dragend-event-crashes-extremely-laggy-collection-of-common-programming-errors\/","title":{"rendered":"Kendo UI TreeView DragEnd event crashes extremely laggy-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;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&#8217;t. I&#8217;ve verified with Firebug that the function is always loading (and is only loading once).<\/p>\n<p>My Kendo UI version is: 2012.2.913<\/p>\n<p>Thanks in advance for any help or advice.<\/p>\n<pre><code>@(Html.Kendo().TreeView()\n.Name(\"CompanyHierarchy\")\n.Events(events =&gt; events\n    .DragEnd(\"HierarchyDragEnd\")\n)\n.BindTo(Model.Hierarchy as System.Collections.IEnumerable, mappings =&gt;\n{\n    mappings.For(binding =&gt; binding\n        .Children(c =&gt; c.Children)\n        .ItemDataBound((item, c) =&gt;\n        {\n            item.Text = c.Name;\n        })\n    );\n})\n.DragAndDrop(true))\n\n\nfunction HierarchyDragEnd(e) {\n    alert(\"here\");\n}\n<\/code><\/pre>\n<p>I don&#8217;t know if it will help but here&#8217;s a picture of it when it&#8217;s &#8216;frozen&#8217; <img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/ivD2I.png\" \/><\/p>\n<ol>\n<li>\n<p>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 :<\/p>\n<pre><code>function HierarchyDragEnd(e) {\n    setTimeout(function() {\n        alert('here');\n    }, 100);\n}\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2014-01-27 08:37:47. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;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&#8217;t. I&#8217;ve verified with Firebug that the function is always loading (and is only loading once). My [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2498","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2498"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2498\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}