Skip to content

Commit

Permalink
avoid calling both getRowValue and getRowFormattedValue
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed Oct 3, 2023
1 parent ca452f7 commit c14f23c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/grid/x-data-grid/src/colDef/gridStringOperators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export const getGridStringQuickFilterFn = tagInternalFilter(
return null;
}
const filterRegex = new RegExp(escapeRegExp(value), 'i');
return (_, row, column, apiRef): boolean => {
const columnValue = apiRef.current.getRowFormattedValue(row, column);
return (columnValue): boolean => {
return columnValue != null ? filterRegex.test(columnValue.toString()) : false;
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ export const buildAggregatedQuickFilterApplier = (
}

const applier = appliers[v];
const value = apiRef.current.getRowValue(row, column);
const value = apiRef.current.getRowFormattedValue(row, column);

if (applier.fn === null) {
continue;
Expand Down

0 comments on commit c14f23c

Please sign in to comment.