Skip DataTables init when stock table is in empty-state row mode

This commit is contained in:
DevSoftTech Server 2026-03-05 14:57:22 +05:30
parent efd509d3ac
commit 0086ab8d65

View File

@ -348,6 +348,14 @@ $ratioValues = $ratio_values ?? [];
return null;
}
const tableEl = document.getElementById('medical-store-stock-table');
if (tableEl) {
const firstBodyCell = tableEl.querySelector('tbody tr td');
if (firstBodyCell && Number(firstBodyCell.getAttribute('colspan') || '0') > 1) {
return null;
}
}
if (jQuery.fn.dataTable.isDataTable(tableId)) {
jQuery(tableId).DataTable().destroy();
}