diff --git a/components/lib/datatable/DataTable.js b/components/lib/datatable/DataTable.js index 2323dd701c..baa3c9677b 100644 --- a/components/lib/datatable/DataTable.js +++ b/components/lib/datatable/DataTable.js @@ -1642,7 +1642,7 @@ export const DataTable = React.forwardRef((inProps, ref) => { ); }; - const createTableBody = (options, selectionModeInColumn, empty, isVirtualScrollerDisabled) => { + const createTableBody = (options, selectionModeInColumn, empty, isVirtualScrollerDisabled, processedData) => { const first = getFirst(); const { rows, columns, contentRef, style, className, spacerStyle, itemSize } = options; @@ -1700,6 +1700,8 @@ export const DataTable = React.forwardRef((inProps, ref) => { onRowUnselect={props.onRowUnselect} onSelectionChange={props.onSelectionChange} paginator={props.paginator} + // pass processedData #7546 + processedData={processedData} reorderableRows={props.reorderableRows} responsiveLayout={props.responsiveLayout} rowClassName={props.rowClassName} @@ -1784,6 +1786,8 @@ export const DataTable = React.forwardRef((inProps, ref) => { onRowUnselect={props.onRowUnselect} onSelectionChange={props.onSelectionChange} paginator={props.paginator} + // pass processedData #7546 + processedData={processedData} reorderableRows={props.reorderableRows} responsiveLayout={props.responsiveLayout} rowClassName={props.rowClassName} @@ -1873,7 +1877,7 @@ export const DataTable = React.forwardRef((inProps, ref) => { }; const tableHeader = createTableHeader(options, empty, _isVirtualScrollerDisabled); - const tableBody = createTableBody(options, selectionModeInColumn, empty, _isVirtualScrollerDisabled); + const tableBody = createTableBody(options, selectionModeInColumn, empty, _isVirtualScrollerDisabled, processedData); const tableFooter = createTableFooter(options); const tableProps = mergeProps( { diff --git a/components/lib/datatable/TableBody.js b/components/lib/datatable/TableBody.js index f75acaf1a3..72afcd97da 100644 --- a/components/lib/datatable/TableBody.js +++ b/components/lib/datatable/TableBody.js @@ -354,7 +354,7 @@ export const TableBody = React.memo( let selection = []; for (let i = rowRangeStart; i <= rowRangeEnd; i++) { - let rangeRowData = props.value[i] ?? props.tableProps.value[i]; + let rangeRowData = props.processedData[i]; if (!isSelectable({ data: rangeRowData, index: i })) { continue;