From fa0ebaa0457cf94106e68bdd51e8c063efb2c41a Mon Sep 17 00:00:00 2001 From: Dwi Swandhana Date: Mon, 13 Apr 2026 16:44:51 +0700 Subject: [PATCH] update --- htdocs/resources/views/pendaftaran.blade.php | 41 +++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/htdocs/resources/views/pendaftaran.blade.php b/htdocs/resources/views/pendaftaran.blade.php index c4f0bb12..2fe3ce4f 100644 --- a/htdocs/resources/views/pendaftaran.blade.php +++ b/htdocs/resources/views/pendaftaran.blade.php @@ -537,6 +537,7 @@ { name: 'nmadendum', type: 'text'}, { name: 'filefoto', type: 'text'}, { name: 'status', type: 'text'}, + { name: 'status_filter', type: 'text'}, { name: 'tandatangan', type: 'text'}, { name: 'jenisfont', type: 'text'}, { name: 'jumlah', type: 'text'}, @@ -573,7 +574,41 @@ } return null; } - var dataAdapter = new $.jqx.dataAdapter(sourcepasiencari, { async: false, loadError: function (xhr, status, error) { console.log('Error loading "' + sourcepasiencari.url + '" : ' + error); } }); + var dataAdapter = new $.jqx.dataAdapter(sourcepasiencari, { + async: false, + beforeLoadComplete: function (records) { + if (!Array.isArray(records)) { + return records; + } + + records.forEach(function (row) { + Object.keys(row).forEach(function (key) { + if (row[key] === null || typeof row[key] === 'undefined') { + row[key] = ''; + } + }); + + var statusText = row.status ? String(row.status).trim() : ''; + if (statusText === '') { + statusText = 'NEW'; + } + + row.status = statusText; + row.status_filter = statusText; + + if (!row.tlsstatus) { + row.tlsstatus = statusText === 'NEW' + ? 'NEW' + : '' + statusText + ''; + } + }); + + return records; + }, + loadError: function (xhr, status, error) { + console.log('Error loading "' + sourcepasiencari.url + '" : ' + error); + } + }); $("#gridpemeriksaan").jqxGrid({ width : '100%', filterable : true, @@ -742,7 +777,9 @@ } }, { text: 'No', filterable: false, datafield: 'noloket', width: 70, cellsalign: 'center', align: 'center' }, - { text: 'Status', filtertype: 'checkedlist', datafield: 'tlsstatus', width: 75, cellsalign: 'left', align: 'center' }, + { text: 'Status', filtertype: 'checkedlist', datafield: 'status_filter', width: 110, cellsalign: 'left', align: 'center', cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties, rowdata) { + return '
' + (rowdata.tlsstatus || value || '') + '
'; + } }, { text: 'AccNumber', datafield: 'nofoto', width: 100, cellsalign: 'left', align: 'center' }, { text: 'No.RM', datafield: 'tlsnoregister', width: 100, cellsalign: 'left', align: 'center' }, { text: 'Name', datafield: 'tlsnama', width: 150, cellsalign: 'left', align: 'center' },