jQuery Sortable connectWith两次调用update方法 [英] jquery Sortable connectWith calls the update method twice

查看:182
本文介绍了jQuery Sortable connectWith两次调用update方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下面的代码中,将项目从列表sortable1移到sortable2时,更新函数被调用了两次.虽然我只需要调用一次该函数:

In the code below the update function gets called twice when an item is moved from list sortable1 to sortable2. Though I need to call that function only once:

$("#sortable1 tbody, #sortable2 tbody").sortable({
    connectWith: '.connectedSortable tbody',
    helper: fixHelper,
    handle : '.handle',
    update : function () {
        var order = $('#sortable1 tbody').sortable('serialize');
    }    
}).disableSelection();

推荐答案

答案来自: 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆