Drag & Drop Rows

Drag & Drop Rows

jamillerjamiller Posts: 27Questions: 0Answers: 0
edited January 2010 in General
I found a plugin for Drag & Drop Columns. Was wondering if there was anything out there for doing the same things but with Rows?

If not, is there an easy way to do this?

Thanks!

Replies

  • jamillerjamiller Posts: 27Questions: 0Answers: 0
    Nevermind! Got it :)

    Basically in my table I have a column that is ordered and this always stays the same no matter the drag and drop. So when, for example, row 6 was dragged to row 1 I needed to update this column to reflect it's new order. This wasn't hard. But when that column was sorted it didn't take into account the new order.

    [code]
    $('#table tbody tr').each(function(i)
    {
    var startPos = table.fnGetPosition(this);
    table.fnUpdate(i+1, startPos, 1);
    });
    [/code]

    Works great :)
  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin
    Hi jamiller,

    Very nice - good to hear you got it "sorted" :-).

    Out of interest, do you have an example that you would be willing to share, or even just the initialisation code? This would be quite a nice demo for DataTables...

    Regards,
    Allan
  • jamillerjamiller Posts: 27Questions: 0Answers: 0
    Hey Allan,

    Absolutely. I am in the process of building an example of this. Will notify you when it's complete.

    Thanks,

    Jeff
  • nathannathan Posts: 3Questions: 0Answers: 0
    Any more info on this or a nudge in the right direction?

    Thanks
  • SelicorSelicor Posts: 11Questions: 0Answers: 0
    would be interested too

    thanks.
  • tdmohrtdmohr Posts: 16Questions: 2Answers: 0
    Would be very, very interested as well as I am currently looking at all jquery options for drag and drop!

    Thanks,
  • SwanSwan Posts: 17Questions: 0Answers: 0
    I would be very interested too but looks like we are too optimistic. :)
  • jocapcjocapc Posts: 45Questions: 0Answers: 0
    Hi,

    I have also created one row drag'drop plugin. You might take a look at the http://jquery-datatables-row-reordering.googlecode.com/svn/trunk/index.html.

    Jovan
  • dinusha86dinusha86 Posts: 1Questions: 0Answers: 0
    Hi,

    I had a requirement to drag a row from one jquery data table and drop it on another jquery datatable. I'm using a jquery datatable knockout binding to (http://knockoutjs.com/) bind data to the data tables. The table tr are draggable through jquery ui draggable.

    I have also added a helper property to draggable so I override the default drag clue.
    i.e:
    ('#table').draggable{
    helper: function(e) {
    return $("");
    }
    }

    This work totally fine in chrome and firefox. but the drag clue doesn't appear in IE. Any solution for this?

    Dinusha
This discussion has been closed.