Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Resolved issue #33 when sorting to page the to page sort was called f…

…irst then the on page sort was called which caused the indexes to become confused
  • Loading branch information...
commit 4de269e53f5d3c313142d5d21c5c7ada314fa5ca 1 parent 4827b8e
@UndefinedOffset authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 javascript/GridFieldSortableRows.js
View
9 javascript/GridFieldSortableRows.js
@@ -5,6 +5,7 @@
var self=this;
var refCheckbox=$(this);
var gridField=this.getGridField();
+ var pageSort=false;
if($(this).is(':checked')) {
gridField.find('table').addClass('dragSorting');
@@ -24,6 +25,11 @@
return ui;
},
update: function(event, ui) {
+ if(pageSort) {
+ pageSort=false;
+ return;
+ }
+
var dataRows=[];
var gridItems=gridField.getItems();
var button=refCheckbox.parent().find('.sortablerows-toggle');
@@ -54,8 +60,7 @@
activeClass: 'sortablerows-droptarget',
tolerance: 'pointer',
drop: function(event, ui) {
- event.stopPropagation();
- event.stopImmediatePropagation();
+ pageSort=true;
var button=refCheckbox.parent().find('.sortablerows-sorttopage');
var itemID=$(ui.draggable).data('id');
Please sign in to comment.
Something went wrong with that request. Please try again.