From e7c3e1ace3e120d321bc3a337cb5fceeeadc82d1 Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskyi Date: Thu, 9 Nov 2023 10:26:00 +0100 Subject: [PATCH] markdownlint --- .../migration-data-grid-v6.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md b/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md index 45f326e91160d..1ebfbeed7f218 100644 --- a/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md +++ b/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md @@ -115,18 +115,18 @@ Below are described the steps you need to make to migrate from v6 to v7. - The signature of the function returned by `getApplyFilterFn` has changed for performance reasons: ```diff -const getApplyFilterFn: GetApplyFilterFn = (filterItem) => { - if (!filterItem.value) { - return null; - } - - const filterRegex = new RegExp(escapeRegExp(filterItem.value), 'i'); -- return (cellParams) => { -- const { value } = cellParams; -+ return (value, row, colDef, apiRef) => { - return value != null ? filterRegex.test(String(value)) : false; - }; -} + const getApplyFilterFn: GetApplyFilterFn = (filterItem) => { + if (!filterItem.value) { + return null; + } + + const filterRegex = new RegExp(escapeRegExp(filterItem.value), 'i'); +- return (cellParams) => { +- const { value } = cellParams; ++ return (value, row, colDef, apiRef) => { + return value != null ? filterRegex.test(String(value)) : false; + }; + } ``` - The `getApplyQuickFilterFnV7` in `GridColDef` was renamed to `getApplyQuickFilterFn`. @@ -135,18 +135,18 @@ const getApplyFilterFn: GetApplyFilterFn = (filterItem) => { - The signature of the function returned by `getApplyQuickFilterFn` has changed for performance reasons: ```diff -const getGridStringQuickFilterFn: GetApplyQuickFilterFn = (value) => { - if (!value) { - return null; - } - const filterRegex = new RegExp(escapeRegExp(value), 'i'); -- return (cellParams) => { -- const { formattedValue } = cellParams; -+ return (value, row, column, apiRef) => { -+ let formattedValue = apiRef.current.getRowFormattedValue(row, column); - return formattedValue != null ? filterRegex.test(formattedValue.toString()) : false; - }; -}; + const getGridStringQuickFilterFn: GetApplyQuickFilterFn = (value) => { + if (!value) { + return null; + } + const filterRegex = new RegExp(escapeRegExp(value), 'i'); +- return (cellParams) => { +- const { formattedValue } = cellParams; ++ return (value, row, column, apiRef) => { ++ let formattedValue = apiRef.current.getRowFormattedValue(row, column); + return formattedValue != null ? filterRegex.test(formattedValue.toString()) : false; + }; + }; ```