question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no data when display none

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
artisticlightcommented, Oct 25, 2017

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.

1reaction
amcdnlcommented, Oct 12, 2016

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

display none if null using data-id - javascript
My frist idea: Loop the content list items and when no .content is available inside, remove the related menu item.
Read more >
display - CSS: Cascading Style Sheets - MDN Web Docs
none. Turns off the display of an element so that it has no effect on layout (the document is rendered as though the...
Read more >
CSS display attribute value changes/resets on page switch
Using "style=display:none;" for the rows is not standard for Datatables and Datatales does not know about these hidden rows.
Read more >
The Key Difference Between Display: None and Visibility
When you set the display property for any given element to none , the element in question will not be rendered, so it...
Read more >
Places it's tempting to use `display: none;`, but don't
As for not tabs and keyboard access, this won't really help out screenreader users. Display:none is bad practice, it's a shame jQuery and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found