WEBVTT

1
00:00:00.600 --> 00:00:10.560
Selecting rows is easy. Knowing which rows are selected after a sort, a filter or a refresh is the part that catches people out, and it comes down to one prop.

2
00:00:12.370 --> 00:00:16.060
A small backlog of tasks and the columns to show them.

3
00:00:24.027 --> 00:00:45.318
Three things on the component. showRowSelection adds the checkbox column. selectionBar floats the action bar. And getRowId is the one that matters: it tells the grid what identifies a row, so a selection survives sorting, filtering and new data arriving. Without it the grid falls back to position, and position changes.

4
00:00:45.634 --> 00:00:54.479
Tick a couple of rows and the bar appears with a live count and the actions you defined. It stays out of the way until there is something to act on.

5
00:00:54.889 --> 00:01:03.269
Now sort the table while those rows are ticked. The same three stay selected, because the grid is tracking ids rather than row numbers.

6
00:01:03.690 --> 00:01:17.364
Over server data the same idea scales: select-all becomes a rule, every row except these, rather than a list of ids the browser would have to hold. Lesson six groups the rows and adds totals.

7
00:01:19.268 --> 00:01:23.376
The file is on the page below. See you in lesson six.
