mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-10-22 15:05:38 +00:00
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:
parent
4827b8e909
commit
4de269e53f
@ -5,6 +5,7 @@
|
|||||||
var self=this;
|
var self=this;
|
||||||
var refCheckbox=$(this);
|
var refCheckbox=$(this);
|
||||||
var gridField=this.getGridField();
|
var gridField=this.getGridField();
|
||||||
|
var pageSort=false;
|
||||||
|
|
||||||
if($(this).is(':checked')) {
|
if($(this).is(':checked')) {
|
||||||
gridField.find('table').addClass('dragSorting');
|
gridField.find('table').addClass('dragSorting');
|
||||||
@ -24,6 +25,11 @@
|
|||||||
return ui;
|
return ui;
|
||||||
},
|
},
|
||||||
update: function(event, ui) {
|
update: function(event, ui) {
|
||||||
|
if(pageSort) {
|
||||||
|
pageSort=false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var dataRows=[];
|
var dataRows=[];
|
||||||
var gridItems=gridField.getItems();
|
var gridItems=gridField.getItems();
|
||||||
var button=refCheckbox.parent().find('.sortablerows-toggle');
|
var button=refCheckbox.parent().find('.sortablerows-toggle');
|
||||||
@ -54,8 +60,7 @@
|
|||||||
activeClass: 'sortablerows-droptarget',
|
activeClass: 'sortablerows-droptarget',
|
||||||
tolerance: 'pointer',
|
tolerance: 'pointer',
|
||||||
drop: function(event, ui) {
|
drop: function(event, ui) {
|
||||||
event.stopPropagation();
|
pageSort=true;
|
||||||
event.stopImmediatePropagation();
|
|
||||||
|
|
||||||
var button=refCheckbox.parent().find('.sortablerows-sorttopage');
|
var button=refCheckbox.parent().find('.sortablerows-sorttopage');
|
||||||
var itemID=$(ui.draggable).data('id');
|
var itemID=$(ui.draggable).data('id');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user