Skip to content

Commit

Permalink
fix: store all data and data in separately
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Jan 3, 2024
1 parent 007ec69 commit dc09e1d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/filterRows.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '';
Expand Down

0 comments on commit dc09e1d

Please sign in to comment.