Skip DataTables init when stock table is in empty-state row mode
This commit is contained in:
parent
efd509d3ac
commit
0086ab8d65
|
|
@ -348,6 +348,14 @@ $ratioValues = $ratio_values ?? [];
|
||||||
return null;
|
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)) {
|
if (jQuery.fn.dataTable.isDataTable(tableId)) {
|
||||||
jQuery(tableId).DataTable().destroy();
|
jQuery(tableId).DataTable().destroy();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user