Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 剑道UI TreeView DragEnd事件崩溃严重滞后_Javascript_Jquery_Kendo Ui - Fatal编程技术网

Javascript 剑道UI TreeView DragEnd事件崩溃严重滞后

Javascript 剑道UI TreeView DragEnd事件崩溃严重滞后,javascript,jquery,kendo-ui,Javascript,Jquery,Kendo Ui,我正在尝试检测我在拖动某个项目后是否将其丢弃在树状视图中。当我这样做时,它只是无限期地挂起搜索javascript函数。有时它在10秒后发现,有时却没有。我已经用Firebug验证了函数总是在加载(并且只加载一次) 我的剑道UI版本是:2012.2.913 提前感谢您的帮助或建议 @(Html.Kendo().TreeView() .Name("CompanyHierarchy") .Events(events => events .DragEnd("HierarchyDragEn

我正在尝试检测我在拖动某个项目后是否将其丢弃在树状视图中。当我这样做时,它只是无限期地挂起搜索javascript函数。有时它在10秒后发现,有时却没有。我已经用Firebug验证了函数总是在加载(并且只加载一次)

我的剑道UI版本是:2012.2.913

提前感谢您的帮助或建议

@(Html.Kendo().TreeView()
.Name("CompanyHierarchy")
.Events(events => events
    .DragEnd("HierarchyDragEnd")
)
.BindTo(Model.Hierarchy as System.Collections.IEnumerable, mappings =>
{
    mappings.For<Models.EnterpriseChildModel>(binding => binding
        .Children(c => c.Children)
        .ItemDataBound((item, c) =>
        {
            item.Text = c.Name;
        })
    );
})
.DragAndDrop(true))

<script type="text/javascript">
function HierarchyDragEnd(e) {
    alert("here");
}</script>
@(Html.Kendo().TreeView()
.名称(“公司层级”)
.Events(Events=>Events
.DragEnd(“HierarchyDragEnd”)
)
.BindTo(Model.Hierarchy为System.Collections.IEnumerable,mappings=>
{
mappings.For(binding=>binding
.儿童(c=>c.儿童)
.ItemDataBound((item,c)=>
{
item.Text=c.名称;
})
);
})
.DragAndDrop(正确))
功能层次结构(e){
警报(“此处”);
}
我不知道它是否有用,但这里有一张它“冻结”时的照片

对于dragend事件,Firefox似乎存在一个bug(在Chrome中,您的示例运行良好)。 解决方法是延迟结果,以便正确注册dragend事件,如下所示:

function HierarchyDragEnd(e) {
    setTimeout(function() {
        alert('here');
    }, 100);
}

我已经为这个组件创建了一个JSFIDLE,它使用了基本的基础知识,这个问题仍然存在。拖放一些东西就行了。在弹出警报窗口之前,您将看到组件冻结几秒钟:就是这样!谢谢希望这件事能很快得到解决。不确定由谁负责(FF或Telerik)。再次感谢你的帮助!