I have a boolean field like a flag to state that row is deleted or not in the table. It displayed using checkbox, so if the data has been deleted, the checkbox value is true and vice versa.
Below is the code to display the table:
<table id=tblEvent class=display cellspacing=0 style=width: 100%>
<thead>
<tr>
<th>@Html.DisplayNameFor(model => model.PIC)</th>
<th>@Html.DisplayNameFor(model => model.Name)</th>
<th>@Html.DisplayNameFor(model => model.StartDate)</th>
<th>@Html.DisplayNameFor(model => model.Status)</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>@Html.DisplayFor(modelItem => item.PIC)</td>
<td>@Html.DisplayFor(modelItem => item.Name)</td>
<td>@Html.DisplayFor(modelItem => item.StartDate)</td>
<td>@Html.EditorFor(modelItem => item.Status)</td>
</tr>
}
</tbody>
</table>
$(document).ready(function () {
$(#tblEvent).dataTable({
order: [[1, desc]]
});
});
In the table I can click the checkbox but I don't know how to handle the click event because I'm using datatables to display the data. How to handle checkbox event using datatable?