I want to disabled the input checkbox which parents is red and has data-id="parent". Actually there are many rows but in which the BIC code is absent i have checked for that and show as red. When we click on the parent row the child row is expand by default it not display. I have tried lots of time but not succeed, Here is the screenshots what i want for:
Image2
This is my code which i have tried:
$('#table1 tr').each(function(){
var attr = $('td').find(".openmodelsepa");
$(attr).parents('tr').css('background-color','#f2dede');
$(attr).parents('tr').next('tr[data-id="child"]').each(function(){
$(this).find('td').each (function() {
$(this).find('input[name="invoicearr[]"]').prop('disabled', true);
});
});
});
Html like that:
<table id="table1" class="tablesorter">
<tbody id="tbody">
<tr data-id="parent" class="parent_172" onclick="show_lines(172)">
<td style="text-align:right;"><input type="checkbox" class="contactsepa" data-contact="172" id="check0" data-mainprice="786.5" name="invoicearr[]" style="display:none" value="786.5"></td>
<td>Aegis Wervingg</td>
<td></td>
<td>NL0000000000000000</td>
<td>MYAC007</td>
<td>50004</td>
<td></td>
<td class="parent_total">786.5 </td>
<td>Open Invoices </td>
<td></td>
</tr>
<tr data-id="child" class="child_172" style="display:none">
<td style="text-align:right;"><input type="checkbox" class="contactsepa" data-contact="172" id="check1" data-mainprice="786.5" name="invoicearr[]" style="display:block" value="786.5">172</td>
<td></td>
<td>586</td>
<td></td>
<td></td>
<td></td>
<td>30-06-2017 11:36:38</td>
<td class="child_total">786.5 </td>
<td>Combine </td>
<td></td>
</tr>
<tr data-id="parent" class="parent_1494" onclick="show_lines(1494)" style="background-color: rgb(242, 222, 222);">
<td style="text-align:right;"><input type="checkbox" class="contactsepa" data-contact="1494" id="check0" data-mainprice="47.88" name="invoicearr[]" style="display:none" value="47.88"></td>
<td>Timmerman Stoffen</td>
<td></td>
<td>NL0000000000000000</td>
<td></td>
<td>090453-9</td>
<td></td>
<td class="parent_total">47.88 </td>
<td>Open Invoices </td>
<td><button type="button" class="openmodelsepa" data-target="1494">Edit</button></td>
</tr>
<tr data-id="child" class="child_1494" style="background-color: rgb(221, 221, 221); opacity: 0.5; display: none;">
<td style="text-align:right;"><input type="checkbox" class="contactsepa" data-contact="1494" id="check1" data-mainprice="47.88" name="invoicearr[]" style="display:block" value="47.88" disabled="disabled">1494</td>
<td></td>
<td>260</td>
<td></td>
<td></td>
<td></td>
<td>16-06-2017 12:00:00</td>
<td class="child_total">47.88 </td>
<td>Normal </td>
<td></td>
</tr><tr data-id="parent" class="parent_2314" onclick="show_lines(2314)" style="background-color: rgb(242, 222, 222);">
<td style="text-align:right;"><input type="checkbox" class="contactsepa" data-contact="2314" id="check0" data-mainprice="4362.9" name="invoicearr[]" style="display:none" value="4362.9"></td>
<td>Renmaart B.V.</td>
<td></td>
<td>NL0000000000000000</td>
<td></td>
<td>100332-1</td>
<td></td>
<td class="parent_total">4362.9 </td>
<td>Open Invoices </td>
<td><button type="button" class="openmodelsepa" data-target="2314">Edit</button></td>
</tr>
</tbody>
</table>


display: none;), so what is the purpose?