-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
p-table width being hard coded onto the table after upgrade to V12 #10903
Comments
I removed columnResizeMode="expand" and the tables work OK again. It appears the width was added to the wrong spot on the table layout, it should be lower in the heirarchy the caption and footer width should not be affected by this change. |
Issue is not clear, please feel free to reopen with a stackblitz example or poject. |
HTML of the table is as follows:
Note the style="width: 3822px;" which is related to columnResizeMode="expand" in table.ts I go into chrome and remove that style width, the screen returns to normal: |
@yigitfindikli Please review additional information and reopen. |
While the modification above works correctly it may be a better solution to remove that line entirely. It is only in the recover on restore logic. |
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
<p-table #table
*ngIf='tableSettings && tableData && !(loading$| async)'
[value]="tableData"
[columns]='tableSettings.selectedColumns'
[frozenColumns]='tableSettings.frozenColumns'
[frozenWidth]='tableSettings.frozenWidth'
[(selection)]='selected'
[paginator]="paginator"
[rows]="50"
[resizableColumns]="true"
[scrollable]="true"
columnResizeMode="expand"
[reorderableColumns]="true"
[rowsPerPageOptions]="[10,20,50,100]"
[exportFilename]="filename"
[exportFunction]="exportFunction"
(onRowSelect)="onRowSelect($event)"
(onRowUnselect)="onRowUnselect($event)"
selectionMode="single"
[globalFilterFields]="tableSettings.globalFilter"
stateStorage="{{stateKey ? 'local' : 'session'}}"
[stateKey]="stateKey"
(onFilter)="onFilterTable($event)"
(onSort)="onSortTable($event)"
(onColReorder)="onColReorderTable($event)"
[dataKey]='dataKey'
(onColResize)="onColResizeTable($event)">
<button class="button-bar p-button-secondary mr-10"
*ngIf='showChevron'
type="button"
pButton
[icon]="chevron ? 'pi pi-arrow-back' : 'pi pi-arrow-forward'"
iconPos="left"
pTooltip='open side panel'
(click)="chevronToggle()">
Current behavior
style="width: 3698px;" -- this has broken all my layouts.
Expected behavior
What is the motivation / use case for changing the behavior?
I use the width of the table and lock it to the area required and then use scrollable to scroll the content only.
If I edit the table in chrome removing the width style the table returns to the original layout.
Please tell us about your environment:
Windows, Chrome, angular 12 prime 12
Angular version: 12.2.13
PrimeNG version: 1212.2.2
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Chrome
Language: TypeScript 4.3.5
Node (for AoT issues):
node --version
= v14.18.1The text was updated successfully, but these errors were encountered: