1

I am using tablednd plugin to drag and drop my table rows everything works fine for me but when I try to use the DragHandle property then neither the rows are dragable nor the hander comes

My Script is as

<script type="text/javascript">
        $(document).ready(function() {
            $('#sort').tableDnD({
                onDrop: function(table, row) {
                  alert(row.id);
                }, 
                            dragHandle: ".dragHandle"
            });
        });
        </script>

When I remove the drag handle then it works and when I include it it does not work.

Any Ideas why its not working

Thanks

davidkonrad
  • 83,997
  • 17
  • 205
  • 265
Zoha Ali Khan
  • 1,659
  • 11
  • 37
  • 56

2 Answers2

3

You might be using an older version (probably Version 0.4).

I had the same issue after downloading the plug-in from GitHub. Seems like you get served the old version, and not the current 0.7

By the way: dragHandle: ".dragHandle" is correct!

rafleo
  • 580
  • 8
  • 28
  • ` $('#table-5').tableDnD({ onDrop: function(table, row) { alert($('#table-5').tableDnDSerialize()); }, dragHandle: "dragHandle" });` This is taken directly from the author's site: http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/ – HPWD Nov 29 '12 at 14:13
  • The GitHub code linked to from several sites is out of date, and doesn't support dragHandle. This is the correct answer. – Keith Palmer Jr. Feb 02 '14 at 20:47
  • You can find later versions here: https://github.com/isocra/TableDnD/tree/master/js – Mike Feb 16 '14 at 23:27
2

Remove . before dragHandle

  $('#sort').tableDnD({
            onDrop: function(table, row) {
              alert(row.id);
            }, 
            dragHandle: "dragHandle"
   });

See example here

Priyank Patel
  • 3,495
  • 20
  • 20