diff --git a/components/lib/datatable/TableFooter.js b/components/lib/datatable/TableFooter.js index 6409f3a33b..4b9d2314ab 100644 --- a/components/lib/datatable/TableFooter.js +++ b/components/lib/datatable/TableFooter.js @@ -4,11 +4,13 @@ import { ColumnGroupBase } from '../columngroup/ColumnGroupBase'; import { useMergeProps } from '../hooks/Hooks'; import { RowBase } from '../row/RowBase'; import { FooterCell } from './FooterCell'; +import { PrimeReactContext } from '../api/Api'; export const TableFooter = React.memo((props) => { const { ptm, ptmo, cx } = props.ptCallbacks; const mergeProps = useMergeProps(); const getRowProps = (row) => ColumnGroupBase.getCProps(row); + const context = React.useContext(PrimeReactContext); const getColumnGroupProps = () => { return props.footerColumnGroup ? ColumnGroupBase.getCProps(props.footerColumnGroup) : undefined; @@ -68,6 +70,7 @@ export const TableFooter = React.memo((props) => { { role: 'row' }, + RowBase.getProps(row.props, context), getRowPTOptions(row, 'root') ); diff --git a/components/lib/datatable/TableHeader.js b/components/lib/datatable/TableHeader.js index ddac9f50ac..79f9dd0486 100644 --- a/components/lib/datatable/TableHeader.js +++ b/components/lib/datatable/TableHeader.js @@ -7,6 +7,7 @@ import { classNames } from '../utils/Utils'; import { ColumnFilter } from './ColumnFilter'; import { HeaderCell } from './HeaderCell'; import { HeaderCheckbox } from './HeaderCheckbox'; +import { PrimeReactContext } from '../api/Api'; export const TableHeader = React.memo((props) => { const [sortableDisabledFieldsState, setSortableDisabledFieldsState] = React.useState([]); @@ -16,6 +17,7 @@ export const TableHeader = React.memo((props) => { const isMultipleSort = props.sortMode === 'multiple'; const isAllSortableDisabled = isSingleSort && allSortableDisabledState; const { ptm, ptmo, cx } = props.ptCallbacks; + const context = React.useContext(PrimeReactContext); const getColumnProp = (column, name) => { return ColumnBase.getCProp(column, name); @@ -241,6 +243,7 @@ export const TableHeader = React.memo((props) => { { role: 'row' }, + RowBase.getProps(row.props, context), getRowPTOptions(row, 'root') ); diff --git a/components/lib/treetable/TreeTableFooter.js b/components/lib/treetable/TreeTableFooter.js index 70b55c0049..13898d8c66 100644 --- a/components/lib/treetable/TreeTableFooter.js +++ b/components/lib/treetable/TreeTableFooter.js @@ -4,10 +4,12 @@ import { ColumnGroupBase } from '../columngroup/ColumnGroupBase'; import { useMergeProps } from '../hooks/Hooks'; import { RowBase } from '../row/RowBase'; import { ObjectUtils } from '../utils/Utils'; +import { PrimeReactContext } from '../api/Api'; export const TreeTableFooter = React.memo((props) => { const mergeProps = useMergeProps(); const { ptm, ptmo, cx } = props.ptCallbacks; + const context = React.useContext(PrimeReactContext); const getColumnProp = (column, name) => { return ColumnBase.getCProp(column, name); @@ -48,7 +50,7 @@ export const TreeTableFooter = React.memo((props) => { const createFooterRow = (row, index) => { const rowColumns = React.Children.toArray(RowBase.getCProp(row, 'children')); const rowFooterCells = rowColumns.map(createFooterCell); - const footerRowProps = mergeProps(ptm('footerRow', { hostName: props.hostName, role: 'row' })); + const footerRowProps = mergeProps(ptm('footerRow', { hostName: props.hostName, role: 'row' }), RowBase.getProps(row.props, context)); return (