The delete functionality
Items can be deleted from the database by sending the DELETE
method request to the http://localhost:8080/api/cars/{carId} endpoint. If we look at the JSON response data, we can see that each car contains a link to itself and it can be accessed from the _links.self.href
node, as shown in the following screenshot. We already used the link
field to set a unique ID for every row in the grid. That row ID can be used in deletion, as we can see later:
The following steps demonstrate how to implement the delete
functionality:
- Here, we will create a button for each row in the table. The field of the button will be
_links.self.href
, which is a link to a car. If you need more complex cell content, you can use arenderCell
prop that you can use to define how a cell content is rendered.
Let's add a new column to the table using renderCell
to render the button
element. The row
argument that is passed...