You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a new grid option `suppressMultiSort`, which when ensures that when
you sort one column, all others should be reset to no sort (as long as
they don't have suppressRemoveSort set to true).
Closes: #2913
Copy file name to clipboardExpand all lines: misc/tutorial/102_sorting.ngdoc
+5-1
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ UI-Grid allows you to sort rows. The feature is on by default. You can set the `
11
11
Sorting can be disabled at the column level by setting `enableSorting: false` in the column def. See the last column below for an example.
12
12
13
13
Multiple columns can be sorted by shift-clicking on the 2-n columns. To see it in action, sort Gender then shift-click Name.
14
+
This feature can be disabled by setting `suppressMultiSort: true`. When combined with the `suppressRemoveSort`, it allows you to at most sort one extra
15
+
column beyond those with suppressRemoveSort turned on. This way, any column that is meant to stay sorted will not be modified.
14
16
15
17
When sorting using the menus, the sorts are additive. So if you have one column sorted and you pick another sort
16
18
from a column menu, it will add on to the existing sort rather than replacing it. You need to use the 'remove sort' option
@@ -59,6 +61,7 @@ For better performance with the following example, you can choose to load the ui
59
61
60
62
vm.gridOptions1 = {
61
63
enableSorting: true,
64
+
suppressMultiSort: true,
62
65
columnDefs: [
63
66
{ field: 'name' },
64
67
{ field: 'gender' },
@@ -80,6 +83,7 @@ For better performance with the following example, you can choose to load the ui
80
83
81
84
vm.gridOptions2 = {
82
85
enableSorting: true,
86
+
suppressMultiSort: true,
83
87
onRegisterApi: function( gridApi ) {
84
88
vm.grid2Api = gridApi;
85
89
},
@@ -122,7 +126,7 @@ For better performance with the following example, you can choose to load the ui
it('if another column has a sort, and both add and suppressMultiSort are set to true, but that other column has suppressRemoveSort, then it shouldn\'t be removed',
0 commit comments