EnVisageOnline/Beta/Source/EnVisage/Views/Scenarios/_expenditures.cshtml

54 lines
2.2 KiB
Plaintext

@model IList<EnVisage.Models.ScenarioModel.ExpenditureItem>
<script type="text/javascript">
function onChCheckExpCat(i) {
if ($('.expenditueCb:checkbox:checked').length > 0)
$("#expCatChecked_" + i).val(document.getElementById("expCatCheckedId_" + i).checked);
else $("#expCatCheckedId_" + i).prop('checked', true);
}
</script>
<table class="table table-striped dataTable" id="uom" style="margin-top: 0px !important;">
<thead style="vertical-align:top;">
<tr>
<th style="width:30px;"></th>
<th>Name</th>
</tr>
</thead>
<tbody>
@{
var GroupName = string.Empty;
}
@if (Model != null)
{
for (var i = 0; i < Model.Count; i++)
{
if (GroupName != Model[i].Group)
{
<tr class="text-bold">
<td colspan="2">@Model[i].Group</td>
</tr>
{
GroupName = Model[i].Group;
}
}
<tr>
<td style="text-align: right;">
<input type="hidden" value="@Model[i].Group" name="expCatGroup[@i]"/>
<input type="hidden" value="@Model[i].Id" name="expCatId[@i]"/>
<input type="hidden" value="@Model[i].Name" name="expCatName[@i]"/>
@if (Model[i].Checked)
{
<input type="checkbox" class="expenditueCb" value="@Model[i].Id" checked="checked" name="expCatCheckedId[@i]" @* disabled*@ id="expCatCheckedId_@i" onclick="onChCheckExpCat(@i); "/>
<input type="hidden" value="true" name="expCatChecked[@i]" id="expCatChecked_@i"/>
}
else
{
<input type="checkbox" class="expenditueCb" value="@Model[i].Id" name="expCatCheckedId[@i]" id="expCatCheckedId_@i" onclick="onChCheckExpCat(@i); " />
<input type="hidden" value="false" name="expCatChecked[@i]" id="expCatChecked_@i"/>
}
</td>
<td>@Model[i].Name</td>
</tr>
}
}
</tbody>
</table>