mirror of
https://github.com/magicbug/Cloudlog
synced 2026-08-13 17:49:35 -04:00
Added a check to ensure DataTable is initialized only if the table contains actual data rows and not just a 'no data' message. This prevents unnecessary initialization and potential errors when the table is empty.
22 lines
671 B
JavaScript
22 lines
671 B
JavaScript
$(document).ready( function () {
|
|
$('#station_logbooks_table').DataTable({
|
|
"stateSave": true,
|
|
"language": {
|
|
url: getDataTablesLanguageUrl(),
|
|
}
|
|
});
|
|
} );
|
|
|
|
$(document).ready( function () {
|
|
// Only initialize DataTable if there are actual data rows (not just the "no data" message)
|
|
var table = $('#station_logbooks_linked_table');
|
|
if (table.find('tbody tr').length > 0 && table.find('tbody tr td[colspan]').length === 0) {
|
|
table.DataTable({
|
|
"stateSave": true,
|
|
"paging": true,
|
|
"language": {
|
|
url: getDataTablesLanguageUrl(),
|
|
}
|
|
});
|
|
}
|
|
} );
|