Advanced Sorting
In this lesson, you'll learn an advanced data sorting technique to sort our app's table by column
We'll cover the following...
We'll cover the following...
Sorting our table component by column
We implemented a client and server-side search interaction earlier. Since you have a Table component, it makes sense to enhance it with advanced interactions. Next, we’ll introduce a sort functionality for each column by using the column headers of the Table.
It is possible to write your own sort function, but I prefer to use a utility library like Lodash for these cases. There are other options, but this is the one I prefer. We have Lodash running on the code widgets in this course but if you are following along on a local setup, install Lodash for our sort function:
npm install lodash
Now we import the sort functionality of ...