View on GitHub

Jquery-table-multi-dnd

Fork tableDND plugin for jQuery. Added multiple drug-n-drop rows and some bug fixes.

Download this project as a .zip file Download this project as a tar.gz file

Documentation

Plugin initialization:

$('#sortable').tableDnD({});

There are a number of parameters you can set in order to control the look and feel of the table and also to add custom behaviour on drag or on drop. The parameters are specified as a map in the usual way and are described below:

Examples

Simple example


$('#sortable').tableDnD({
    onDragClass: "myDragClass",
    onDragStart: function(table, draggedRow, dragObjs) {
        console.log('start');
    },
    onDrop: function(table, droppedRow, dragObjs) {
        console.log('stop');
    }
});

Drug and drop row on table:

row 1text text text
row 2text text text
row 3text text text
row 4text text text
row 5text text text

Example with multiple drug-n-drop


$('#sortable').tableDnD({
    onDragClass: "myDragClass",
    checkableClass: "trCheck",
    onDragStart: function(table, draggedRow, dragObjs) {
        console.log('start');
    },
    onDrop: function(table, droppedRow, dragObjs) {
        console.log('stop');
    }
});

Select several rows in the table and drug them:

1text text text
2text text text
3text text text
4text text text
5text text text

Example with several sections:

Select several rows in the table and drug them:

H1H2
1text text text
2text text text
3text text text
H1H2
4text text text
5text text text
6text text text