ngx-datatable icon indicating copy to clipboard operation
ngx-datatable copied to clipboard

Rows disappear

Open mailok opened this issue 6 years ago • 7 comments

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
   
  • Table version: 0.8.x "@swimlane/ngx-datatable": "12.0.0",

  • Angular version: 2.0.x angular/animations: "6.0.2", angular/cdk: "6.0.2", angular/common: "6.0.1", angular/compiler: "6.0.1", angular/core: "6.0.1", angular/forms: "6.0.1", angular/http: "6.0.1", angular/material: "6.0.2", angular/platform-browser: "6.0.1", angular/platform-browser-dynamic: "6.0.1", angular/router: "6.0.1", "core-js": "2.5.6", "hammerjs": "2.0.8", "material-design-icons": "3.0.1", "rxjs": "6.1.0", "rxjs-compat": "6.1.0", "validator": "10.1.0", "zone.js": "0.8.26"

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] Google Chrome Version 66.0.3359.181 (Official Build) (64-bit)

  • Language: [all | TypeScript X.X | ES6/7 | ES5] "typescript": "2.7.2"

mailok avatar Jun 11 '18 13:06 mailok

I'm experiencing this too.

nhducseuit avatar Jun 18 '18 03:06 nhducseuit

Here too

mikenemat avatar Jul 02 '18 19:07 mikenemat

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

swseverance avatar Jul 12 '18 17:07 swseverance

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;

ahmetacer5 avatar Sep 18 '18 09:09 ahmetacer5

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?

nonconceptual avatar Apr 08 '20 22:04 nonconceptual

I'm seeing this as well

Steeze avatar Nov 13 '20 21:11 Steeze

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 😣)

hwaynefair avatar May 06 '22 05:05 hwaynefair