4
What I need is that when selected Item "Ball" which is a child node of check "1031-HUBCAP ...", the Father node is selected as well. Or Do not let select the child node if the parent node is not selected.
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">Peça</th>
</tr>
</thead>
<tbody>
@{
for (int i = 0; i < ViewBag.Lista.Count; i++)
{
<tr>
@if (ViewBag.Lista[i].TemPeca > 0)
{
<td>
@if (ViewBag.Lista[i].ACHOU == "N")
{
<input type="text" name="optionsObsPeca[]" value="@ViewBag.Lista[i].Obs" autocomplete="off" />
<input type="checkbox" name="options[]" id="id[]" value="@ViewBag.Lista[i].Id" checked />
@ViewBag.Lista[i].Descricao
}
else // ITENS
{
<p>
<input type="checkbox" name="optionsItens[]" att="@ViewBag.Lista[i].Id" value="@ViewBag.Lista[i].IdItem" />
@ViewBag.Lista[i].DescricaoItem
</p>
}
</td>
}
else
{
<td>
@if (ViewBag.lista[i].ACHOU == "N")
{
<input type="text" name="optionsObsPeca[]" value="" autocomplete="off" />
<input type="checkbox" name="options[]" id="id[]" value="@ViewBag.Lista[i].Id" />
@ViewBag.Lista[i].Descricao
}
else // ITENS
{
<p>
<input type="checkbox" name="optionsItens[]" att="@ViewBag.Lista[i].Id" value="@ViewBag.Lista[i].IdItem" />
@ViewBag.Lista[i].DescricaoItem
</p>
}
</td>
}
</tr>
cont++;
}
}
</table>
Thank you, Id[] really are without anything, were just unsuccessful attempts ...
– Danielle Arruda torres