Ngx-datatable: no data when display none

Created on 7 Oct 2016  路  5Comments  路  Source: swimlane/ngx-datatable

Hi, when my rows.length == 0 I show a message that "there isn't data" and I hide <datatable> using .hiddenWhenNoData{display:none;} but when data exist I remove this class and datatable exist but rows aren't displayed, when I begin to scroll rows are displayed.

Here's gif:

rosw not displayed

Here's Plunker:

http://plnkr.co/edit/J70gN73dpc3efvVNjZBz?p=preview

Bug Investigate

Most helpful comment

I am encountering this problem. I have two tables and hide one while the other is displayed and toggle between them. If the data changes in a table that is hidden, when the containing div becomes visible the table displays the same behavior shown above. I don't know how to fix it.

All 5 comments

Use visiblility:hidden instead. Its because it has to calculate the page size based on the height and since its not 0/0 its not shown.

We actually have a directive that polls for visibility, I'd look in that to see why thats not working - https://github.com/swimlane/angular2-data-table/blob/master/src/directives/visibility.directive.ts

yes visibility:hidden works but as you said visibility keep a big height, so If I show a message "no data" after my I have to scroll to see it ! I really need display:none isntead visibility, I will wait and hope this will be solved, thanks a lot

I think this is fixed :) @amcdnl can you confirm that we can display:none datatable if rows.length == 0

pretty awesome

I am encountering this problem. I have two tables and hide one while the other is displayed and toggle between them. If the data changes in a table that is hidden, when the containing div becomes visible the table displays the same behavior shown above. I don't know how to fix it.

this should be opened again

Was this page helpful?
0 / 5 - 0 ratings