swimlane / ngx-datatable

✨ A feature-rich yet lightweight data-table crafted for Angular
http://swimlane.github.io/ngx-datatable/
MIT License
4.63k stars 1.68k forks source link

Rows disappear #1450

Open mailok opened 6 years ago

mailok commented 6 years ago

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

[X ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior I have two tables, in two tabs, when one of the tables is hidden and the scroll is not at the beginning, when the table is shown again the rows disappear, until the scroll moves.

Expected behavior

I expected him to show me the table with his rows Reproduction of the problem screen

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

     SO: Windows 10 x64
     IDE:Webstorm
nhducseuit commented 6 years ago

I'm experiencing this too.

mikenemat commented 6 years ago

Here too

swseverance commented 6 years ago

I've experienced this too. A workaround is to force the table to be rebuilt each time you need to display it by putting the table inside an ngIf

ahmetacer5 commented 6 years ago

I had the same problem. So applied my own solution and it worked. On the table scroll event record the last Hscroll position than when you switch back set the scroll again.

ngxTable.element.getElementsByTagName('datatable-body')[0].scrollTop = lastScrollTop;

nonconceptual commented 4 years ago

I am having this problem as well. No luck with setting the scrollTop value.

I am not using tabs as in the example above - I have the ngx-datatable inside another component which can be resized. If I scroll the table, then resize it, it has no visible rows. Is there some way to prompt the table to redraw itself, or re-check which rows are visible?

Steeze commented 3 years ago

I'm seeing this as well

hwaynefair commented 2 years ago

mine doesn't happen with scrolling - simply clicking between the two tabs I have - each having its own ngx table - The rows disappear for the other tab (when going back to it) - but if I adjust the window size the rows (on the other tab) are visible again (when I go back to it)... No fixes after 4 years? the only "hack" that worked for me was to use an ngIf as suggested above on each div container for each table... I change this from true to false and back to true when either the window is resized OR when the tab is clicked... This seems to clear up most of the issue for me (but I still dont like it 😣)