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 CSS and responsive structure improvements #4078

Closed
mertsincan opened this issue Feb 20, 2023 · 15 comments
Closed

DataTable CSS and responsive structure improvements #4078

mertsincan opened this issue Feb 20, 2023 · 15 comments
Assignees
Labels
Type: Breaking Change Issue contains a breaking change related to a specific component Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@mertsincan
Copy link
Member

mertsincan commented Feb 20, 2023

Details;
primefaces/primeng#12047

Breaking changes are;

  • responsiveLayout is now defaults to scroll. The 'stack' mode is deprecated.
  • scrollDirection is now obselete
  • autoLayout is obselete as table is based on auto layout now, tableStyle="table-layout:fixed" can be used for fixed.
@mertsincan mertsincan added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add Type: Breaking Change Issue contains a breaking change related to a specific component labels Feb 20, 2023
@mertsincan mertsincan added this to the 9.1.2 milestone Feb 20, 2023
@mertsincan mertsincan self-assigned this Feb 20, 2023
@mertsincan mertsincan changed the title Table CSS and responsive structure Improvements DataTable CSS and responsive structure improvements Feb 20, 2023
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 20, 2023
@mertsincan mertsincan removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 20, 2023
mertsincan added a commit that referenced this issue Feb 20, 2023
mertsincan added a commit that referenced this issue Feb 20, 2023
@franmc01
Copy link
Contributor

Please do not remove the stack mode.

I understand that there are issues that mention that mention that they can not coexist together but I use both modes and totally possible with a simple conditional, in my case I have a hook called useMediaquery with which I decide that in web this scroll mode and tablet and lower in stack mode.

@Exodiel
Copy link

Exodiel commented Mar 22, 2023

Like @francmarin98 said, its posible work with that props just using a conditional, its not a big deal

@Vitalii-Pidoprygora
Copy link

That is a big drawback that 'stack' mode is deprecated.

@franmc01
Copy link
Contributor

franmc01 commented May 2, 2023

@mertsincan can stack mode be brought back? consider the issue of accessibility, usability, readability and use.

@giovannispd
Copy link

@mertsincan and @melloware, the prop tableStyle="table-layout:fixed" solved my problem with table layout and resized columns... but where is documented this setting??? no mention for this in primereact ad primeflex documentation!!
documentation for the latest version is almost very uncomfortable and incomplete for many new features (either for content and layout)

@melloware
Copy link
Member

@giovannispd table-layout is not a React or PrimeReact property it is just CSS: https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout

However there probably should be some sort of showcase example showing fixed columns with this setting.

@giovannispd
Copy link

ok... sorry but this is not clear in docs, and in my opinion all these main use cases should be treated.
primereact (and all prime libs) strengths has been always ease of use and great documentation, but lately i have some difficult with docs and backwards compatibility with previous version (6.6 in my case).
anyway thanks always for great support!

@franmc01
Copy link
Contributor

What chance is there that I can get the datatable component separately like it was in version 8.7.3? My company needs that way of presentation.

CC: @melloware @mertsincan

@melloware
Copy link
Member

@t1fmarin my only suggestion would be to check out the 8.7.3 tag here in GitHUb and copy the old Datatable component into your project along with any CSS necessary and maintain it as "` or something like that.

@julianomqs
Copy link

Hello,

I managed to recreate the responsive datatable with a small custom datatable component and CSS.

You can give it a look here:
https://codesandbox.io/s/responsive-datatable-yyjsp4

The main code is in files datatable.js and datatable.css.

Regards,

Juliano

@melloware
Copy link
Member

Very nice @julianomqs

@franmc01
Copy link
Contributor

franmc01 commented Oct 8, 2023

I still keep wondering why stack mode was deprecated, it was something cool.
@julianomqs good job with that recreation of stack mode, nice.

@enzolry
Copy link

enzolry commented Nov 3, 2023

Thanks a lot @julianomqs you saved me a lot of trouble !

@mgc90
Copy link

mgc90 commented Apr 19, 2024

Hi!
Im putting in practice the @julianomqs solution (Excellent, thanks!!) in my code.
Im using the products DataTable template and some of my columns got's already the prop body (like body={statusBodyTemplate}). What can I do to applicate boths body properties? ChatGPT toldme that use boths functions in one but thats is not working for me. This is my first real project. Thanks community!

@julianomqs
Copy link

julianomqs commented Apr 19, 2024

Hello @mgc90,

I changed my example to accept a property render, a function that accept four arguments:

  • The value of the column;
  • The row data;
  • The body properties;
  • The index of the column.

This is like I do in my company and works well.

In the datatable.js file you can see the change to accept the property render, and in the App.js file where the property render is used to put the column Quantity in bold.

Link:
https://codesandbox.io/p/sandbox/hungry-roman-yyjsp4

Hope this helps.

Regards,

Juliano

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Breaking Change Issue contains a breaking change related to a specific component Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

9 participants