I am currently working with a table that looks like this:
<table id="tblTasks">
<thead>
<tr>
<th>Name</th>
<th>Due</th>
<th>Category</th>
<th>Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
Above the table, I also have a script like this:
<script id="taskRow" type="text/x-jQuery-tmpl">
<tr>
<td>${task}</td>
<td>
<time datetime="${requiredBy}">${requiredBy}</time>
</td>
</td>
<td>${category}</td>
<td>
<nav>
<a href="#" class="editRow" data-task-id="${id}">Edit</a>
<a href="#" class="completed">Complete</a>
<a href="#" class="deleteRow" data-task-id="${id}">Delete</a>
</nav>
</td>
</tr>
</script>
Currently, when the Delete button is clicked, the following code is executed:
storageEngine.delete('task', $(evt.target).data().taskId, ....
In addition to this functionality, I now have a requirement of deleting all tasks. I am trying to figure out how to loop through all the rows in the table, locate the Delete buttons, and apply the storageEngine.delete function. Can you provide guidance on how I can achieve this?