Datatable - Virtual scrolling not working in 4.1.0-rc.3
I'm submitting a ...
[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 Datatable is not showing data when virtual scrolling is enabled.
Expected behavior Datatable should show data.
Minimal reproduction of the problem with instructions Using the following table (from your primeng-quickstart-webpack) with virtual scrolling enabled:
<p-dataTable [value]="cars" selectionMode="single" [(selection)]="selectedCar" (onRowSelect)="onRowSelect($event)" [rows]="10" scrollHeight="200px" scrollable="true" virtualScroll="virtualScroll">
<p-header>CRUD for Cars</p-header>
<p-column field="vin" header="Vin" [sortable]="true"></p-column>
<p-column field="year" header="Year" [sortable]="true"></p-column>
<p-column field="brand" header="Brand" [sortable]="true"></p-column>
<p-column field="color" header="Color" [sortable]="true"></p-column>
<p-footer><div class="ui-helper-clearfix" style="width:100%"><button type="button" pButton icon="fa-plus" style="float:left" (click)="showDialogToAdd()" label="Add"></button></div></p-footer>
</p-dataTable>
No data is visible.
When you remove virtualScroll="virtualScroll", data becomes visible.
Please tell us about your environment: Windows 10
-
Angular version: 4.2.4
-
PrimeNG version: 4.1.0-rc.3
-
Browser: Chrome 59 | Firefox 54
We cannot replicate, live demo;
https://www.primefaces.org/primeng/#/datatable/scroll
Please provide a test case based on plunkr below and we'll review again.
http://plnkr.co/edit/VwHkrSoVISBtXMra2zXw
@cagataycivici Thanks for your reply. You can see the issue here: http://plnkr.co/edit/U0wKhgLutJ1YogAKv90E?p=preview
First there is no data visible. It becomes visible when you remove virtualScroll="virtualScroll" from app.template.html.
I've got the same problem.
@cagataycivici could you please review, problem still persists in 4.1.2 - see plunkr: http://plnkr.co/edit/Tr2qmjuVQPiKE4glwlSz?p=preview
Thank you in advance.
Solved this issue by adding [totalRecords] value to datatable.