Drag and drop contents from one table to another using jQuery

后端 未结 1 1269
别跟我提以往
别跟我提以往 2021-01-26 03:28

Maybe it is something simple but I cannot get this right.

I have a table with data, say, 4 columns and 4 rows. I want to enter the data items from this table into anothe

相关标签:
1条回答
  • 2021-01-26 04:08

    If you search this site probably you would get the solution. Anyways I found something following on this website but don't remember the link to actual post. Anyways :

    $(document).ready(function() {
    $tabs = $(".tabbable");
    
    $('.nav-tabs a').click(function(e) {
        e.preventDefault();
        $(this).tab('show');
    })
    
    $( "tbody.connectedSortable" )
        .sortable({
            connectWith: ".connectedSortable",
            items: "> tr:not(:first)",
            appendTo: $tabs,
            helper:"clone",
            zIndex: 999990,
            start: function(){ $tabs.addClass("dragging") },
            stop: function(){ $tabs.removeClass("dragging") }
        })
        .disableSelection()
    ;
    
    var $tab_items = $( ".nav-tabs > li", $tabs ).droppable({
      accept: ".connectedSortable tr",
      hoverClass: "ui-state-hover",
      over: function( event, ui ) {
        var $item = $( this );
        $item.find("a").tab("show");
    
      },
      drop: function( event, ui ) {
        return false;
      }
    });
    

    });

    try this on jsfiddle http://jsfiddle.net/martyk/Kzf62/18/

    0 讨论(0)
提交回复
热议问题