diff --git a/javascript/GridFieldSortableRows.js b/javascript/GridFieldSortableRows.js index ce67476..615a3dd 100644 --- a/javascript/GridFieldSortableRows.js +++ b/javascript/GridFieldSortableRows.js @@ -1,129 +1,131 @@ (function($) { - $('.ss-gridfield .gridfield-sortablerows input').entwine({ - onmatch: function() { - var self=this; - var refCheckbox=$(this); - - var gridField=$(this).getGridField(); - - if($(this).is(':checked')) { - gridField.find('table').addClass('dragSorting'); - }else { - gridField.find('table').removeClass('dragSorting'); - } - - gridField.find('tbody').sortable({ - opacity: 0.6, - disabled: ($(this).is(':checked')==false), - helper: function(e, ui) { - //Maintains width of the columns - ui.children().each(function() { - $(this).width($(this).width()); - }); - - return ui; - }, - update: function(event, ui) { - var dataRows=[]; - var gridItems=gridField.getItems(); - var button=refCheckbox.parent().find('.sortablerows-toggle'); - - - for(var i=0;i