mesa-fab-approval/Fab2ApprovalSystem/Views/Training/ViewTrainingDocsPartial-old.cshtml
Jonathan Ouellette 580e90f6a2 initial add
2022-09-27 14:10:30 -07:00

45 lines
1.0 KiB
Plaintext

@model IEnumerable<Fab2ApprovalSystem.Models.TrainingDocAck>
<table class="table" id="fileTable">
<tr>
<th>
@Html.DisplayNameFor(model => model.FileName)
</th>
<th>
@Html.DisplayNameFor(model => model.Reviewed)
</th>
<th>
</th>
<th></th>
</tr>
@foreach (var item in Model) {
int i = 0;
<tr>
<td class="FileName">
<a href="#" onclick="MarkAsReviewed()" data-id="@item.FileName">@item.FileName</a>
</td>
@if (item.Reviewed == true)
{
<td>Complete</td>
}
else
{
<td>Incomplete</td>
}
</tr>
}
</table>
<script type="text/javascript">
$('#fileTable').on('click', '.FileName', function (event) {
var item = $(event.target).parent()
var isItemCompleted = item.hasClass('completed')
var itemId = item.attr('data-id')
alert('clicked item ' + itemId + ', which has completed currently set to ' + isItemCompleted)
})
</script>