diff --git a/app/Views/medical/invoice_med_draft.php b/app/Views/medical/invoice_med_draft.php index 45094b2..1a8bcc3 100644 --- a/app/Views/medical/invoice_med_draft.php +++ b/app/Views/medical/invoice_med_draft.php @@ -121,9 +121,42 @@ table.columns(col).search(val).draw(); }); + function reloadInvoiceTable(resetPaging) { + var reset = !!resetPaging; + + if (table && table.ajax && typeof table.ajax.reload === 'function') { + table.ajax.reload(null, reset); + return; + } + + if (table && typeof table.api === 'function') { + var api = table.api(); + if (api && api.ajax && typeof api.ajax.reload === 'function') { + api.ajax.reload(null, reset); + return; + } + if (api && typeof api.draw === 'function') { + api.draw(!reset); + return; + } + } + + if (table && typeof table.draw === 'function') { + table.draw(!reset); + return; + } + + if (table && typeof table.fnDraw === 'function') { + table.fnDraw(); + return; + } + + jQuery(tableId + ' tbody').html('