Skip to content

Commit

Permalink
Fix primefaces#5252: Treetable frozen column
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Nov 6, 2023
1 parent e6d5c5b commit 6199896
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions components/lib/treetable/TreeTableBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ const classes = {
}),
sortBadge: 'p-sortable-column-badge',
headerTitle: 'p-column-title',
headerCell: ({ headerProps: props, column, options, getColumnProp, sorted, frozen }) =>
headerCell: ({ headerProps: props, frozen, column, options, getColumnProp, sorted }) =>
options.filterOnly
? 'p-filter-column'
? classNames('p-filter-column', { 'p-frozen-column': frozen })
: classNames({
'p-sortable-column': getColumnProp(column, 'sortable'),
'p-highlight': sorted,
Expand Down
9 changes: 5 additions & 4 deletions components/lib/treetable/TreeTableHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,21 +250,22 @@ export const TreeTableHeader = React.memo((props) => {
}

if (options.filterOnly) {
const frozen = getColumnProp(column, 'frozen');
const headerCellProps = mergeProps(
{
key: getColumnProp(column, 'columnKey') || getColumnProp(column, 'field') || options.index,
className: classNames(cx('headerCell', { options }), getColumnProp(column, 'filterHeaderClassName')),
className: classNames(cx('headerCell', { options, frozen }), getColumnProp(column, 'filterHeaderClassName')),
style: getColumnProp(column, 'filterHeaderStyle') || getColumnProp(column, 'style'),
rowSpan: getColumnProp(column, 'rowSpan'),
colSpan: getColumnProp(column, 'colSpan'),
'data-p-sortable-column': getColumnProp(column, 'sortable'),
'data-p-resizable-column': props.resizableColumns,
'data-p-frozen-column': getColumnProp(column, 'frozen')
'data-p-frozen-column': frozen
},
getColumnPTOptions(column, 'root'),
getColumnPTOptions(column, 'headerCell', {
context: {
frozen: getColumnProp(column, 'frozen')
frozen: frozen
}
})
);
Expand Down Expand Up @@ -293,7 +294,7 @@ export const TreeTableHeader = React.memo((props) => {
const resizer = createResizer(column);
const headerCellProps = mergeProps(
{
className: classNames(getColumnProp(column, 'headerClassName') || getColumnProp(column, 'className'), cx('headerCell', { headerProps: props, column, options, getColumnProp, sorted, frozen })),
className: classNames(getColumnProp(column, 'headerClassName') || getColumnProp(column, 'className'), cx('headerCell', { headerProps: props, frozen, column, options, getColumnProp, sorted })),
style: getColumnProp(column, 'headerStyle') || getColumnProp(column, 'style'),
tabIndex: getColumnProp(column, 'sortable') ? props.tabIndex : null,
onClick: (e) => onHeaderClick(e, column),
Expand Down

0 comments on commit 6199896

Please sign in to comment.