Skip to content

Commit

Permalink
Merge pull request #183 from shariquerik/filter-row-pass-data
Browse files Browse the repository at this point in the history
fix: pass data as second parameter to filterMethod
  • Loading branch information
shariquerik authored Dec 21, 2023
2 parents 50b44bf + 2c36123 commit 8f074a8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/filterRows.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function filterRows(rows, filters, data) {
const cells = filteredRows.map(row => row[colIndex]);

let filter = guessFilter(keyword);
let filterMethod = getFilterMethod(rows, filter, data);
let filterMethod = getFilterMethod(rows, data, filter);

if (filterMethod) {
filteredRowIndices = filterMethod(filter.text, cells);
Expand All @@ -30,10 +30,9 @@ export default function filterRows(rows, filters, data) {
return filteredRowIndices;
};

function getFilterMethod(rows, filter, data) {
function getFilterMethod(rows, data, filter) {
const getFormattedValue = cell => {
let formatter = CellManager.getCustomCellFormatter(cell);
data
if (formatter && cell.content) {
cell.html = formatter(cell.content, rows[cell.rowIndex], cell.column, rows[cell.rowIndex], filter);
return stripHTML(cell.html);
Expand Down

0 comments on commit 8f074a8

Please sign in to comment.