diff --git a/javascript/GridFieldSortableRows.js b/javascript/GridFieldSortableRows.js index cfde054..86a178d 100644 --- a/javascript/GridFieldSortableRows.js +++ b/javascript/GridFieldSortableRows.js @@ -5,6 +5,7 @@ var self=this; var refCheckbox=$(this); var gridField=this.getGridField(); + var form=gridField.closest('form'); var pageSort=false; if($(this).is(':checked')) { @@ -49,7 +50,9 @@ name: 'ItemIDs', value: dataRows } - ]}); + ]},function() { + form.removeClass('loading'); + }); } }).disableSelection(); @@ -109,6 +112,8 @@ var form = gridField.closest('form'), focusedElName = gridField.find(':input:focus').attr('name'); // Save focused element for restoring after refresh + form.addClass('loading'); + ajaxOpts.data = ajaxOpts.data.concat(form.find(':input').serializeArray()); // Include any GET parameters from the current URL, as the view state might depend on it.