Delete Row

Demo
NameEmailActions
Joe Smith[email protected]
Fuqua Tarkenton[email protected]

Explanation #

This example shows how to implement a delete button that removes a table row upon completion. First let’s look at the table body:

 1<table>
 2    <thead>
 3        <tr>
 4            <th>Name</th>
 5            <th>Email</th>
 6            <th>Actions</th>
 7        </tr>
 8    </thead>
 9    <tbody>
10        <tr>
11            <td>Joe Smith</td>
12            <td>[email protected]</td>
13            <td>
14                <button
15                    class="error"
16                    data-on-click="confirm('Are you sure?') && @delete('/examples/delete_row/0')"
17                    data-indicator-_fetching
18                    data-attr-disabled="$_fetching"
19                >
20                    Delete
21                </button>
22            </td>
23        </tr>
24    </tbody>
25</table>

The row has a normal confirm to confirm() the delete action.