Resolved issue #33 when sorting to page the to page sort was called first then the on page sort was called which caused the indexes to become confused

This commit is contained in:
Ed 2013-04-26 20:25:56 -03:00
parent 4827b8e909
commit 4de269e53f
1 changed files with 7 additions and 2 deletions

View File

@ -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');