diff --git a/resources/views/activity/index.blade.php b/resources/views/activity/index.blade.php index eda029b..2f8d2df 100644 --- a/resources/views/activity/index.blade.php +++ b/resources/views/activity/index.blade.php @@ -261,37 +261,67 @@ }, }, actions: { - title: 'Action', - render: (item, data) => { - const status = data.status; // Anggap status berada di dalam objek data - const dokumenjaminan = data.dokumenjaminan || []; + title: 'Action', + render: (item, data) => { + const status = data.status; // Anggap status berada di dalam objek data + const dokumenjaminan = data.dokumenjaminan || []; - return ` + return `
`; - }, -}, + }, + }, } - + }; + + + let dataTable = new KTDataTable(element, dataTableOptions); + function highlightFreezeRows() { + const table = document.querySelector('#permohonan-table table[data-datatable-table="true"]'); + if (!table) return; + + const rows = table.querySelectorAll('tbody tr'); + + rows.forEach(row => { + const statusCell = row.cells[7]; + if (!statusCell) return; + + const statusText = statusCell.textContent.trim().toLowerCase(); + + if (statusText === 'freeze') { + row.classList.add('bg-red-400', 'text-white'); + } else { + row.classList.remove('bg-red-400', 'text-white'); + } + }); + } + + // Polling setiap 1 detik untuk sementara + setInterval(() => { + highlightFreezeRows(); + }, 500); + + + searchInput.addEventListener('input', function() { const searchValue = this.value.trim(); dataTable.search(searchValue, true);