Primeng: Datatable w/ scrollable and scrollHeight=100% miscomputes scrollHeight

Created on 27 Sep 2016  路  6Comments  路  Source: primefaces/primeng

When using a Datatable with scrollable="true" and scrollHeight="100%", the scrollable area ends up being too long by what appears to be the height of the table header, and extends below the table's container element.

Looking at the datable.ts code, it looks to me like the computed scrollBody maxHeight fails to take into account the fixed table header.

        <p-dataTable
                [value]="studyTags"
                scrollable="true"
                scrollHeight="100%"

From PrimeNG's datatable.ts:

        if(this.scrollHeight) {
            if(this.percentageScrollHeight)
                this.scrollBody.style.maxHeight = this.domHandler.getOuterHeight(this.el.nativeElement.parentElement) * (parseInt(this.scrollHeight) / 100) + 'px';

scrollable

defect

Most helpful comment

this bug still exists.

All 6 comments

Seems like this issue reappeared. The corresponding code has been completely reworked and I cannot find anything resembling the logic that was introduced to fix this issue.

There are still quite a few issues with the scrollable data table even in RC2.
Try to make is scrollable with resizable and reordering columns. Fill it with data, so scroll appears. Fill with less data so there's no scroll. Play with headers size and order and you will see all kinds of strange behavior.

Hi, Indeed I think that this issue is related to a post i made : https://github.com/primefaces/primeng/issues/1905

this bug still exists.

is there any workaround for this?

Could you please create a new issue and post the number here, we can check it for 4-RC2.

Was this page helpful?
0 / 5 - 0 ratings