Deleting Existing Entries

Learn how to add a bulk delete feature to remove multiple entries simultaneously.

Just as we started the previous lesson, we need to do the same for the "Bulk Delete" button. The idea is that whenever some rows are selected with the checkbox, we show a "Bulk Delete" button that users can use to delete multiple students at once. Take a look at the code below:

Add the BulkDelete component

We've added a new component in our Header called BulkDelete, which is located in the components folder.


Implement the "Bulk Delete" button

Head over to Table.svelte to see what other changes we'll need for our BulkDelete component. Notice that we've imported the dispatch function and used it inside the toggle function.

Because our BulkDelete ...