primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
9.84k stars 4.5k forks source link

Component: p-table frozen columns are not frozen #15718

Open urielTwito opened 1 month ago

urielTwito commented 1 month ago

Describe the bug

I can not create frozen columns in p-table (it used to work before) the complete example can be found here https://stackblitz.com/edit/stackblitz-starters-1egmcq?file=src%2Fmain.ts

<p-table [columns]="scrollableCols" [frozenColumns]="frozenCols" [value]="cars5" [scrollable]="true" scrollHeight="200px" frozenWidth="400px">

I defined my frozen columns like this this.frozenCols = [ { field: 'vin', header: 'Vin' }, { field: 'year', header: 'Year' }, ]; }

I defined the other columns like this this.scrollableCols = [ { field: 'brand', header: 'Brand' }, { field: 'color', header: 'Color' }, { field: 'brand', header: 'Brand' }, { field: 'color', header: 'Color' }, { field: 'brand', header: 'Brand' }, { field: 'color', header: 'Color' }, { field: 'brand', header: 'Brand' }, { field: 'color', header: 'Color' }, { field: 'brand', header: 'Brand' }, { field: 'color', header: 'Color' }, { field: 'brand', header: 'Brand' }, { field: 'color', header: 'Color' }, { field: 'brand', header: 'Brand' }, { field: 'color', header: 'Color' }, { field: 'brand', header: 'Brand' }, { field: 'color', header: 'Color' }, ];

the data is populated with this service this.cars5 = this.carService.getCarsMedium();

the result should be that vin and year should appear in the grid frozen but they are not shown at all

Environment

angular project under windows

Reproducer

No response

Angular version

16.2.12

PrimeNG version

16.9.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.10.0

Browser(s)

chrome

Steps to reproduce the behavior

run this example https://stackblitz.com/edit/stackblitz-starters-1egmcq?file=src%2Fmain.ts

Expected behavior

expecting the vin and year field to show and be frozen inside p-table component

urielTwito commented 1 month ago

for some reason the link is not opened just copy the url and past it in the address bar https://stackblitz.com/edit/stackblitz-starters-1egmcq?file=src%2Fmain.ts