From dc09e1d1b2fa1d4091ba00ab21f7e4a7e6e8a1b9 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 3 Jan 2024 14:51:12 +0530 Subject: [PATCH] fix: store all data and data in separately --- src/filterRows.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/filterRows.js b/src/filterRows.js index b5a7149..78f6d26 100644 --- a/src/filterRows.js +++ b/src/filterRows.js @@ -30,16 +30,15 @@ export default function filterRows(rows, filters, data) { return filteredRowIndices; }; -function getFilterMethod(rows, data, filter) { +function getFilterMethod(rows, allData, filter) { const getFormattedValue = cell => { let formatter = CellManager.getCustomCellFormatter(cell); - if (data && data.data && data.data.length) { - data = data.data[cell.rowIndex]; - } else { - data = rows[cell.rowIndex]; + let rowData = rows[cell.rowIndex]; + if (allData && allData.data && allData.data.length) { + rowData = allData.data[cell.rowIndex]; } if (formatter && cell.content) { - cell.html = formatter(cell.content, rows[cell.rowIndex], cell.column, data, filter); + cell.html = formatter(cell.content, rows[cell.rowIndex], cell.column, rowData, filter); return stripHTML(cell.html); } return cell.content || '';