fix: added dataManager in filterRows function
This commit is contained in:
parent
6d29880fb7
commit
50b44bfb09
@ -427,7 +427,7 @@ export default class DataManager {
|
||||
}
|
||||
|
||||
filterRows(filters) {
|
||||
return this.options.filterRows(this.rows, filters)
|
||||
return this.options.filterRows(this.rows, filters, this)
|
||||
.then(result => {
|
||||
if (!result) {
|
||||
result = this.getAllRowIndices();
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { isNumber, stripHTML } from './utils';
|
||||
import CellManager from './cellmanager';
|
||||
|
||||
export default function filterRows(rows, filters) {
|
||||
export default function filterRows(rows, filters, data) {
|
||||
let filteredRowIndices = [];
|
||||
|
||||
if (Object.keys(filters).length === 0) {
|
||||
@ -18,7 +18,7 @@ export default function filterRows(rows, filters) {
|
||||
const cells = filteredRows.map(row => row[colIndex]);
|
||||
|
||||
let filter = guessFilter(keyword);
|
||||
let filterMethod = getFilterMethod(rows, filter);
|
||||
let filterMethod = getFilterMethod(rows, filter, data);
|
||||
|
||||
if (filterMethod) {
|
||||
filteredRowIndices = filterMethod(filter.text, cells);
|
||||
@ -30,9 +30,10 @@ export default function filterRows(rows, filters) {
|
||||
return filteredRowIndices;
|
||||
};
|
||||
|
||||
function getFilterMethod(rows, filter) {
|
||||
function getFilterMethod(rows, filter, data) {
|
||||
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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user