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 scrollHeight can't be changed #662

Closed
Yousefjb opened this issue Dec 5, 2018 · 5 comments
Closed

Datatable scrollHeight can't be changed #662

Yousefjb opened this issue Dec 5, 2018 · 5 comments
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@Yousefjb
Copy link
Contributor

Yousefjb commented Dec 5, 2018

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

[ ] bug report
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Current behavior

Setting scrollHeight to Datatable pass the value to ScrollableView which calculate the height once and does not recalculate again until I unmount datatable and remount again.

I want to set scrollHeight based on the available space in the page, basically I want to set the scrollHeight on window resize

Expected behavior
If I set scrollHeight to "80%" I want it be 80% when window resize as well.

Please tell us about your environment:

  • React version:
    ^16.6.3

  • PrimeReact version:
    ^2.0.0-rc.1

  • 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 ]
    all

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    ES6

@neelav
Copy link

neelav commented Jan 17, 2019

I have a similar issue where I'm setting the scrollHeight to a pixel height. And then I have some page interactions where I want to update the scrollHeight props but it has no effect. Looking at the code I see that ScrollableView.componentDidMount calls this.setScrollHeight();. However componentDidUpdate does not call that method. This seems like a bug to me more than a feature request.

Snippet of code I have where this.state.scrollHeight can be dynamically updated but the datatable does not update max-height:

         <DataTable
                scrollable
                scrollHeight={this.state.scrollHeight}
                rows={numRows}
                value={data}
                resizableColumns
            >
                { dynamicColumns }
            </DataTable>

@neelav
Copy link

neelav commented Mar 18, 2019

any update on this issue would be much appreciated. I'm hoping it's as simple as calling this.setScrollHeight() within componentDidUpdate.

@cakienes
Copy link
Contributor

Any update on this ? Having same issue..

@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label Apr 22, 2019
@mertsincan mertsincan added this to the 3.1.3 milestone Apr 22, 2019
@mertsincan
Copy link
Member

Fixed now ;)

@neelav
Copy link

neelav commented Apr 22, 2019

thanks!

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

No branches or pull requests

4 participants