mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 02:14:13 +00:00
Fix CSV-Download at LBA
This commit is contained in:
@@ -906,6 +906,7 @@ $options = json_decode($options);
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div id="csv-button-container" class="mb-2"></div>
|
||||
<table style="width:100%" class="table-sm table table-hover table-striped table-bordered table-condensed text-center" id="qsoList">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -206,6 +206,10 @@ function loadQSOTable(rows) {
|
||||
|
||||
// Prevent initializing if already a DataTable
|
||||
if ($.fn.DataTable.isDataTable($table)) {
|
||||
// Remove ALL buttons containers to prevent duplicates
|
||||
$('#qsoList').prev('.dt-buttons').remove();
|
||||
$('#qsoList_wrapper').find('.dt-buttons').remove();
|
||||
$('.dt-buttons').remove();
|
||||
$table.DataTable().clear().destroy();
|
||||
}
|
||||
|
||||
@@ -232,14 +236,15 @@ function loadQSOTable(rows) {
|
||||
{ targets: $(".antennaelevation-column-sort").index(), type: "numbersort" },
|
||||
{ targets: $(".stationpower-column-sort").index(), type: "numbersort" },
|
||||
],
|
||||
dom: 'Bfrtip',
|
||||
dom: 'frtip',
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
className: 'mb-1 btn btn-sm btn-primary', // Bootstrap classes
|
||||
init: function(api, node, config) {
|
||||
$(node).removeClass('dt-button').addClass('btn btn-primary'); // Ensure Bootstrap class applies
|
||||
},
|
||||
text: 'CSV',
|
||||
className: 'mb-1 btn btn-sm btn-primary',
|
||||
filename: function() {
|
||||
return 'qso_export_' + new Date().toISOString().slice(0,10);
|
||||
},
|
||||
exportOptions: {
|
||||
columns: ':visible:not(:eq(0))', // export all visible except column 4
|
||||
format: {
|
||||
@@ -275,6 +280,9 @@ function loadQSOTable(rows) {
|
||||
]
|
||||
});
|
||||
|
||||
// Place buttons in custom container
|
||||
table.buttons().container().appendTo('#csv-button-container');
|
||||
|
||||
for (i = 0; i < rows.length; i++) {
|
||||
let qso = rows[i];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user