From 0086ab8d650536c8a10d60df75ee15b21bf52cce Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Thu, 5 Mar 2026 14:57:22 +0530 Subject: [PATCH] Skip DataTables init when stock table is in empty-state row mode --- app/Views/medical/store_stock_result.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Views/medical/store_stock_result.php b/app/Views/medical/store_stock_result.php index 94119c1..b9e6301 100644 --- a/app/Views/medical/store_stock_result.php +++ b/app/Views/medical/store_stock_result.php @@ -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(); }