Hi
how i can set che column width in px as for version 6.6 (style={width:'100px'})?
new documentation is not clear for this... and the minWidth properties create conflict with resize of the column.
thanks
DataTable: fixed column width in px
Working in PR 9.4.0 with reproducer: https://stackblitz.com/edit/react-poccy ... c%2FApp.js
so most likely a bug in 6.6.0 that has since been fixed.
so most likely a bug in 6.6.0 that has since been fixed.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
Thanks for the example and fast response.Melloware wrote: ↑16 May 2023, 16:28Working in PR 9.4.0 with reproducer: https://stackblitz.com/edit/react-poccy ... c%2FApp.js
so most likely a bug in 6.6.0 that has since been fixed.
i did a test adding properties to save state of table in sessionstorage (same as my case but i did it manually) in your example:
Code: Select all
stateStorage="session"
stateKey="dt-state-demo-local"
state saved previous reload...
i think this is the problem that somehow affect my datatable that non reset the correct width after reload.
This might be your issue: https://github.com/primefaces/primereact/issues/4211 ??
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
the issue is different, because i reconstruct datatable with dynamic column and the width setted in column creation, but i thinkMelloware wrote: ↑17 May 2023, 17:11This might be your issue: https://github.com/primefaces/primereact/issues/4211 ??
that the origin of both issues might be the same...
i tryed to reproduce the problem:softsize wrote: ↑18 May 2023, 08:23the issue is different, because i reconstruct datatable with dynamic column and the width setted in column creation, but i thinkMelloware wrote: ↑17 May 2023, 17:11This might be your issue: https://github.com/primefaces/primereact/issues/4211 ??
that the origin of both issues might be the same...
https://stackblitz.com/edit/react-poccy ... src/App.js
if you enlarge the fields untile hscroll appeared and reload content, datatable graphically don't have the correct width (often all column has the same size) and the scrollbar disappeared
although inspecting html element the width is effectively correct as setted
Furthermore, continuing to test for solution, the "autolayout" and width don't work even in non resizable table if there are many columns as:
https://stackblitz.com/edit/react-pocc ... rc/App.js
columns are all tight and same sized...
if i set resizable={true}, "autolayout" magically work.
solved with:
property in DataTable
Code: Select all
tableStyle={{tableLayout:'fixed'}}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 14 guests