image of my columns and checkboxes
<table class="table table-striped grid-table">
<tr>
<th>Id</th>
<th>Code</th>
<th>
<input type="checkbox" id="box"/>
</th>
</tr>
@foreach (var item in (IEnumerable<cit.Models.getPersonPerName_Result>)Model)
{
<tr>
<td>@item.idper</td>
<td>@item.pername</td>
<td>
<div class="pure-checkbox">
<input type="checkbox" id="@item.idper" class="chk" checked="@(item.idperson == ViewBag.idperson ? true : false)" name="@item.id.ToString()" id="@item.id.ToString()" />
<label for="@item.id.ToString()"></label>
</div>
</td>
</tr>
}
In the code above, I have created a pure-checkbox
class where item.idper
represents values of my document's column and item.pername
represents codes in another column. The pure-checkbox
column is specifically designed for checkboxes that can be individually checked but I want to enable checking all checkboxes at once using an input type method.