primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Datatable - Virtual scrolling not working in 4.1.0-rc.3

Open fxmfr opened this issue 9 years ago • 5 comments

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

fxmfr avatar Jul 11 '17 08:07 fxmfr

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 avatar Jul 11 '17 08:07 cagataycivici

@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.

fxmfr avatar Jul 11 '17 09:07 fxmfr

I've got the same problem.

KiyokoAsakura avatar Jul 19 '17 15:07 KiyokoAsakura

@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.

fxmfr avatar Jul 27 '17 08:07 fxmfr

Solved this issue by adding [totalRecords] value to datatable.

fxmfr avatar Aug 07 '17 13:08 fxmfr