Skip to content

Commit 064c2d1

Browse files
Datatable: cellMemo parameter for radio/checkbox cells (#8098)
* Create cell memoization options in datatable props, including detailed documentation * Prettier * Fixed TS error * Fixed TS error * Update datatable.d.ts * Created ref for expandedRows in TableBody.js so that the onRowToggle runs with the most updated value * cellMemo set to false now stops memoization of Radio/Checkbox cells as well --------- Co-authored-by: Melloware <mellowaredev@gmail.com>
1 parent 1e7b69d commit 064c2d1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

components/lib/datatable/BodyCell.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,8 @@ export const RadioCheckCell = React.memo(
683683
return <Cell {...props} />;
684684
},
685685
(prevProps, nextProps) => {
686+
if (nextProps.cellMemo === false) return false;
687+
686688
const keysToCompare = ['isRowSelected', 'field', 'allowCellSelection', 'isCellSelected', 'editMode', 'index', 'tabIndex', 'editing', 'expanded', 'editingMeta', 'rowData'];
687689

688690
return ObjectUtils.selectiveCompare(prevProps, nextProps, keysToCompare);

0 commit comments

Comments
 (0)