0

私は現在のプロジェクトで jquery draggable を使用しています。たとえば、jquery draggable について問題があります。リストから項目 b リストをドラッグ アンド ドロップしますが、この時点で問題が発生します。

$(function () {
    $( "#list1 li" ).draggable({
        cursor: "move",
        appendTo: "body",
        helper: "clone"
    });

    $( "#list3" ).droppable({
        activeClass: "ui-state-default",
        hoverClass: "ui-state-hover",
        accept: ":not(.ui-sortable-helper)",
        drop: function( event, ui ) {

            $( "<li></li>" ).text( ui.draggable.text() ).appendTo( this );
            ui.draggable.remove();
            $.ajax({
                url: "@Url.Action("AddTag", "Home")",
                type: "POST",
                dataType: "json",
                data: { tagId: ui.draggable.attr("data"),Id:@ViewContext.RouteData.Values["id"] },
                success: function (data) {
                },
                error: function () {
                }
            });
        },
    });

    $( "#list3 li" ).draggable({
        cursor: "move",
        appendTo: "body",
        helper: "clone",
        stop:function(event,ui){
            $(this).remove();
            $.ajax({
                url: "@Url.Action("DeleteTag", "Home")",
                type: "POST",
                dataType: "json",
                data: { tagId: $(this).attr("data"),Id:@ViewContext.RouteData.Values["id"] },
                success: function (data) {                        
                },
                error: function () {
                }
            });
        }
    });
});
4

0 に答える 0