1
- The ` mdSort ` and ` md-sort-header ` are used, respectively, to add sorting behavior, state, and display
1
+ The ` mdSort ` and ` md-sort-header ` are used, respectively, to add sorting state and display
2
2
to tabular data.
3
3
4
4
<!-- example(sort-overview) -->
5
5
6
- # Adding sort to table headers
6
+ ### Adding sort to table headers
7
7
8
8
To add sorting behavior and styling to a set of table headers, add the ` <md-sort-header> ` component
9
9
to each header and provide an ` id ` that will identify it. These headers should be contained within a
@@ -14,18 +14,20 @@ Users can trigger the sort header through a mouse click or keyboard action. When
14
14
` mdSort ` will emit an ` mdSortChange ` event that contains the ID of the header triggered and the
15
15
direction to sort (` asc ` or ` desc ` ).
16
16
17
- ### Changing the sort order
17
+ #### Changing the sort order
18
18
19
19
By default, a sort header starts its sorting at ` asc ` and then ` desc ` . Triggering the sort header
20
20
after ` desc ` will remove sorting.
21
21
22
- To reverse the sort order for all headers, set the ` mdSortStart ` to ` desc ` on the ` mdSort ` directive.
23
- To reverse the order only for a specific header, set the ` start ` input only on the header instead.
22
+ To reverse the sort order for all headers, set the ` mdSortStart ` to ` desc ` on the ` mdSort `
23
+ directive. To reverse the order only for a specific header, set the ` start ` input only on the header
24
+ instead.
24
25
25
- To prevent the user from removing sort altogether after it is applied, set ` mdSortDisableClear ` to
26
- ` true ` on the ` mdSort ` to affect all headers, or set ` disableClear ` to ` true ` on a specific header.
26
+ To prevent the user from clearing the sort sort state from an already sorted column, set
27
+ ` mdSortDisableClear ` to ` true ` on the ` mdSort ` to affect all headers, or set ` disableClear ` to
28
+ ` true ` on a specific header.
27
29
28
- ### Using sort with the md-table
30
+ #### Using sort with the md-table
29
31
30
32
When used on an ` md-table ` header, it is not required to set an ` md-sort-header ` id on because
31
33
by default it will use the id of the column.
0 commit comments