Skip to content
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

DataTable State: columnwidths are not restored correctly when using scrollable and resizableColumns props #1311

Closed
ibrdavid opened this issue Jun 1, 2021 · 3 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@ibrdavid
Copy link

ibrdavid commented Jun 1, 2021

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting

CodeSandbox Case (Bug Reports)
https://codesandbox.io/s/datatable-scrollable-resizable-widthrestorenotworking-szcps

Current behavior
I am using a DataTable with resizableColumns, vertical scrolling and state. In this case, you recommend using flex for defining inital column widths. But when the DateTable restores the state, the values for each column width is set as "width: 123px" instead of "flex: 0 0 123px", so the column keeps it's predefined width and doesn't get it's stored width from the state.

  • Vue version: 3.0.11

  • PrimeVue version: 3.5

@cagataycivici cagataycivici self-assigned this Jul 26, 2021
@cagataycivici cagataycivici modified the milestones: 3.6.0, 3.6.1 Jul 26, 2021
@cagataycivici cagataycivici removed their assignment Jul 26, 2021
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jul 26, 2021
@cagataycivici cagataycivici modified the milestones: 3.6.1, 2.4.3, 3.6.2, 3.6.3, 3.6.4 Aug 5, 2021
@tugcekucukoglu tugcekucukoglu changed the title DataTable State: columnwidths are not restored correctly when using vertical scrolling and resizableColumns DataTable State: columnwidths are not restored correctly when using scrollable and resizableColumns props Aug 12, 2021
@tugcekucukoglu tugcekucukoglu self-assigned this Aug 12, 2021
@JohnCampionJr
Copy link
Contributor

FWIW, I just tried this code locally and it does not solve the column resizing not being restored; might want to take another look.
The updated column widths are being saved to storage, but they seem to be reset there prior to being loaded.

@JohnCampionJr
Copy link
Contributor

As I said, it is still not working in 3.7.0. See the codebox forked from the original issue. It does not save/restore widths

https://codesandbox.io/s/datatable-scrollable-resizable-widthrestorenotworking-forked-b4i2z

@ibrdavid
Copy link
Author

I updated my codesandbox example, using primevue 3.7.1 and vue 3.1.1 and it is still not working as expected. In my example i have one column with a predefined width of "flex: 0 0 80px" (due to fact this is a scrollable table). The restored width-value is set as width: 123px" instead of "flex: 0 0 123px". This leads to an style-definition of style="flex: 0 0 80px; width: 123px;", which in fact leads to the old predefined columnwidth of 80px and not the 123px, i want to be restored.

CodeSandbox Case (Bug Reports)
https://codesandbox.io/s/datatable-scrollable-resizable-widthrestorenotworking-szcps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

4 participants