diff --git a/components/lib/datatable/BodyCell.js b/components/lib/datatable/BodyCell.js index ae22589e45..ea71ae6955 100644 --- a/components/lib/datatable/BodyCell.js +++ b/components/lib/datatable/BodyCell.js @@ -509,7 +509,7 @@ export class BodyCell extends Component { const editor = this.getColumnProp('editor'); const frozen = this.getColumnProp('frozen'); const value = this.resolveFieldData(); - const cellClassName = ObjectUtils.getPropValue(this.props.cellClassName, value, { props: this.props.tableProps, rowData: this.props.rowData }); + const cellClassName = ObjectUtils.getPropValue(this.props.cellClassName, value, { props: this.props, rowData: this.props.rowData, column: this.props.column }); const className = classNames(this.getColumnProp('bodyClassName'), this.getColumnProp('class'), cellClassName, { 'p-selection-column': selectionMode !== null, 'p-editable-column': editor, diff --git a/components/lib/datatable/DataTable.d.ts b/components/lib/datatable/DataTable.d.ts index 8436035618..e88c30836d 100644 --- a/components/lib/datatable/DataTable.d.ts +++ b/components/lib/datatable/DataTable.d.ts @@ -210,6 +210,7 @@ interface DataTableRowClassNameOptions { interface DataTableCellClassNameOptions { props: DataTableProps; rowData: any; + column: Column; } interface DataTableShowSelectionElementOptions {