Add class and value to QSO checkboxes for batch actions
Added a 'qso-checkbox' class and value attribute to QSO checkboxes in the QSL print table for easier selection and identification. Updated JavaScript to use the new class for batch selection, row highlighting, and QSO actions, improving code clarity and maintainability.
这个提交包含在:
父节点
095bf32781
当前提交
b66261179c
共有 2 个文件被更改,包括 10 次插入 和 10 次删除
|
|
@ -45,7 +45,7 @@ if ($qsos->result() != NULL) {
|
|||
|
||||
foreach ($qsos->result() as $qsl) {
|
||||
echo '<tr id="qslprint_'.$qsl->COL_PRIMARY_KEY.'">';
|
||||
echo '<td style=\'text-align: center\'><div class="form-check"><input class="form-check-input" type="checkbox" /></div></td>';
|
||||
echo '<td style=\'text-align: center\'><div class="form-check"><input class="form-check-input qso-checkbox" type="checkbox" value="'.$qsl->COL_PRIMARY_KEY.'" /></div></td>';
|
||||
?><td style='text-align: center'><span class="qso_call"><a id="edit_qso" href="javascript:displayQso(<?php echo $qsl->COL_PRIMARY_KEY; ?>);"><?php echo str_replace("0","Ø",strtoupper($qsl->COL_CALL)); ?></a><a target="_blank" href="https://www.qrz.com/db/<?php echo strtoupper($qsl->COL_CALL); ?>"><img width="16" height="16" src="<?php echo base_url(); ?>images/icons/qrz.png" alt="Lookup <?php echo strtoupper($qsl->COL_CALL); ?> on QRZ.com"></a> <a target="_blank" href="https://www.hamqth.com/<?php echo strtoupper($qsl->COL_CALL); ?>"><img width="16" height="16" src="<?php echo base_url(); ?>images/icons/hamqth.png" alt="Lookup <?php echo strtoupper($qsl->COL_CALL); ?> on HamQTH"></a> <a target="_blank" href="http://www.eqsl.cc/Member.cfm?<?php echo strtoupper($qsl->COL_CALL); ?>"><img width="16" height="16" src="<?php echo base_url(); ?>images/icons/eqsl.png" alt="Lookup <?php echo strtoupper($qsl->COL_CALL); ?> on eQSL.cc"></a></td><?php
|
||||
echo '<td style=\'text-align: center\'>'; $timestamp = strtotime($qsl->COL_TIME_ON); echo date($custom_date_format, $timestamp); echo '</td>';
|
||||
echo '<td style=\'text-align: center\'>'; $timestamp = strtotime($qsl->COL_TIME_ON); echo date('H:i', $timestamp); echo '</td>';
|
||||
|
|
|
|||
|
|
@ -149,19 +149,19 @@ function mark_qsl_sent(id, method) {
|
|||
|
||||
$(document).on('change', '#checkBoxAll', function (event) {
|
||||
if (this.checked) {
|
||||
$('#qslprint_table tbody tr').each(function (i) {
|
||||
$(this).addClass('activeRow');
|
||||
$(this).find("input[type=checkbox]").prop("checked", true);
|
||||
$('#qslprint_table tbody tr .qso-checkbox').each(function (i) {
|
||||
$(this).prop("checked", true);
|
||||
$(this).closest('tr').addClass('activeRow');
|
||||
});
|
||||
} else {
|
||||
$('#qslprint_table tbody tr').each(function (i) {
|
||||
$(this).removeClass('activeRow');
|
||||
$(this).find("input[type=checkbox]").prop("checked", false);
|
||||
$('#qslprint_table tbody tr .qso-checkbox').each(function (i) {
|
||||
$(this).prop("checked", false);
|
||||
$(this).closest('tr').removeClass('activeRow');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '#qslprint_table input[type="checkbox"]', function() {
|
||||
$(document).on('click', '.qso-checkbox', function() {
|
||||
if ($(this).is(":checked")) {
|
||||
$(this).closest('tr').addClass('activeRow');
|
||||
} else {
|
||||
|
|
@ -170,7 +170,7 @@ $(document).on('click', '#qslprint_table input[type="checkbox"]', function() {
|
|||
});
|
||||
|
||||
function markSelectedQsos() {
|
||||
var elements = $('#qslprint_table tbody input:checked');
|
||||
var elements = $('.qso-checkbox:checked');
|
||||
var nElements = elements.length;
|
||||
if (nElements == 0) {
|
||||
return;
|
||||
|
|
@ -202,7 +202,7 @@ function markSelectedQsos() {
|
|||
}
|
||||
|
||||
function removeSelectedQsos() {
|
||||
var elements = $('#qslprint_table tbody input:checked');
|
||||
var elements = $('.qso-checkbox:checked');
|
||||
var nElements = elements.length;
|
||||
if (nElements == 0) {
|
||||
return;
|
||||
|
|
|
|||
正在加载…
在新工单中引用