Fix mark all checkbox functionality in QSL Print page

Co-authored-by: magicbug <84308+magicbug@users.noreply.github.com>
这个提交包含在:
copilot-swe-agent[bot] 2025-07-30 15:09:35 +00:00
父节点 03bc01bea8
当前提交 8d1232ca0c

查看文件

@ -77,8 +77,20 @@ $(".station_id").change(function(){
type: 'post', type: 'post',
data: {'station_id': station_id}, data: {'station_id': station_id},
success: function(html) { success: function(html) {
// Destroy existing DataTable if it exists
if ($.fn.DataTable.isDataTable('#qslprint_table')) {
$('#qslprint_table').DataTable().destroy();
}
$('.resulttable').empty(); $('.resulttable').empty();
$('.resulttable').append(html); $('.resulttable').append(html);
// Reinitialize DataTable
$('#qslprint_table').DataTable({
"stateSave": true,
paging: false,
"language": {
url: getDataTablesLanguageUrl(),
}
});
} }
}); });
}); });
@ -135,7 +147,7 @@ function mark_qsl_sent(id, method) {
}); });
} }
$('#checkBoxAll').change(function (event) { $(document).on('change', '#checkBoxAll', function (event) {
if (this.checked) { if (this.checked) {
$('.qslprint tbody tr').each(function (i) { $('.qslprint tbody tr').each(function (i) {
$(this).closest('tr').addClass('activeRow'); $(this).closest('tr').addClass('activeRow');
@ -149,7 +161,7 @@ $('#checkBoxAll').change(function (event) {
} }
}); });
$('.qslprint').on('click', 'input[type="checkbox"]', function() { $(document).on('click', '.qslprint input[type="checkbox"]', function() {
if ($(this).is(":checked")) { if ($(this).is(":checked")) {
$(this).closest('tr').addClass('activeRow'); $(this).closest('tr').addClass('activeRow');
} else { } else {