Primeng: Table: Virtual scroll broken

Created on 18 Jul 2018  路  4Comments  路  Source: primefaces/primeng

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior
Virtual Scroll changes data but the rows stay at the top of the grid

Expected behavior
Virtual scroll loads appropriate data in the appropriate location

Minimal reproduction of the problem with instructions
Go to the demo site and the issue is visible there
https://www.primefaces.org/primeng/#/table/scroll

Please tell us about your environment:

  • PrimeNG version: 6.0.1
defect

Most helpful comment

ah you are right! It was as simple as that. When you add:

.ui-table-scrollable-body-table{
  position:absolute;
}

it seems to work. It is a nice quickfix I guess.

All 4 comments

woahh I was trying to get virtual scroll to work, and it took me so long to figure out the problem was not with my code.

Lazyloading is working correctly but as said the rows are not shown within the view, making virtual scroll unusable

https://github.com/primefaces/primeng/blob/master/src/app/components/table/table.ts#L1768

This should be giving the grid a class of ui-table-virtual-table which would make the table position absolute but this class is not getting added.

I even tried adding position: absolute to tableStyleClass and tableStyle with no luck

ah you are right! It was as simple as that. When you add:

.ui-table-scrollable-body-table{
  position:absolute;
}

it seems to work. It is a nice quickfix I guess.

I have created a PR to fix this - https://github.com/primefaces/primeng/pull/6163

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Helayxa picture Helayxa  路  3Comments

pchristou picture pchristou  路  3Comments

lilling picture lilling  路  3Comments

miresk picture miresk  路  3Comments

gatapia picture gatapia  路  3Comments