【问题标题】:JQuery UI sortable receive event doesn't capture drops within the same list. Which event does?JQuery UI 可排序接收事件不会在同一列表中捕获丢弃。哪个活动做?
【发布时间】:2017-05-03 02:59:25
【问题描述】:

使用可排序的 JQuery UI,我对“接收”事件进行了 ajax 调用。这捕获将卡片从一个列表拖放到另一个列表。但是,它不会捕获将卡片从列表中拖动到列表中的不同位置。代码如下:

<script src="http://code.jquery.com/jquery-3.2.1.js"></script>
<script src="http://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

<script type="text/javascript">
$(function linkUp() {
    $("#IssueList25").sortable({
        connectWith: ".connectedSortable",
        receive: function(event, ui) {
            var droppedIssueId = ui.item.attr("id");
            var destListId = this.id;
            var sourceListId = ui.sender[0].id;
            var destList = $('#IssueList25').sortable('toArray').toString();

            $.ajax({
                async: true,
                type: "GET",
                url: "Lists.aspx",
                data:"event=receive&sourceListId = " + sourceListId + "&destListId = " + destListId + "&droppedIssueId=" + droppedIssueId + "&destList=" + destList,
                dataType: "text"
            });
        }
    });});
</script>

将卡片放入同一个列表时会触发不同的事件吗?

【问题讨论】:

    标签: jquery-ui jquery-ui-sortable


    【解决方案1】:

    看起来答案是“out”,尽管它确实会触发两次以从一个列表拖动到另一个列表。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-14
      • 2018-03-17
      • 1970-01-01
      相关资源
      最近更新 更多