Skip to content

Commit

Permalink
Merge pull request #192 from shariquerik/minor-fix-4
Browse files Browse the repository at this point in the history
fix: store all data and data in separately
  • Loading branch information
shariquerik committed Jan 3, 2024
2 parents 007ec69 + dc09e1d commit cca14e0
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 cca14e0

Please sign in to comment.