diff --git a/src/filterRows.js b/src/filterRows.js index b5a7149..d326aca 100644 --- a/src/filterRows.js +++ b/src/filterRows.js @@ -30,13 +30,12 @@ export default function filterRows(rows, filters, data) { return filteredRowIndices; }; -function getFilterMethod(rows, data, filter) { +function getFilterMethod(rows, all_data, 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 row_data = rows[cell.rowIndex]; + if (all_data && all_data.data && all_data.data.length) { + row_data = all_data.data[cell.rowIndex]; } if (formatter && cell.content) { cell.html = formatter(cell.content, rows[cell.rowIndex], cell.column, data, filter);