We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ded2c12 commit 97e0ffaCopy full SHA for 97e0ffa
src/js/core/factories/GridColumn.js
@@ -869,6 +869,15 @@ angular.module('ui.grid')
869
* @description Removes column from the grid sorting
870
*/
871
GridColumn.prototype.unsort = function () {
872
+ //Decrease priority for every col where priority is higher than the removed sort's priority.
873
+ var thisPriority = this.sort.priority;
874
+
875
+ this.grid.columns.forEach(function (col) {
876
+ if (col.sort && col.sort.priority !== undefined && col.sort.priority > thisPriority) {
877
+ col.sort.priority -= 1;
878
+ }
879
+ });
880
881
this.sort = {};
882
this.grid.api.core.raise.sortChanged( this.grid, this.grid.getColumnSorting() );
883
};
0 commit comments