* Fix bug#15087

This commit is contained in:
zenggang
2021-09-13 09:17:09 +08:00
parent c411204b8b
commit 62bcf528b2
+23 -1
View File
@@ -44,7 +44,29 @@ $(function()
var $checkbox = $(this);
var $tr = $checkbox.closest('tr');
var rowID = $tr.data('id');
var isAllRowChecked = !$tbody.find('tr[data-parent="' + rowID + '"] input:checkbox:not(:checked)').length;
if($tbody.find('tr[data-parent="' + rowID + '"] .program-checkbox').length > 0)
{
var notCheckedCount = 0;
$tbody.find('tr[data-parent="' + rowID + '"]').each(function()
{
if($(this).find('.program-checkbox').length > 0)
{
/* Get lines input length. */
var lineRowID = $(this).data('id');
notCheckedCount = $tbody.find('tr[data-parent="' + lineRowID + '"] input:checkbox:not(:checked)').length + notCheckedCount;
}
else
{
notCheckedCount = $(this).find('input:checkbox:not(:checked)').length + notCheckedCount;
}
});
var isAllRowChecked = !notCheckedCount;
}
else
{
var isAllRowChecked = !$tbody.find('tr[data-parent="' + rowID + '"] input:checkbox:not(:checked)').length;
}
$checkbox.toggleClass('checked', isAllRowChecked);
});
}