'No data available' only in 1st column

'No data available' only in 1st column

elstupidelstupid Posts: 2Questions: 1Answers: 0

I'm experiencing the same problem as in #36253

That one was a long time ago but maybe somehow that problem has returned once again into code.

  • DT version is 2.3.2, but also present in 2.2.2
  • I'm using AJAX to get the data and autowidth for columns is off.

My screenshots (in German language):

Before refresh

After refresh

What could be wrong? Thanks for your time.

Answers

  • kthorngrenkthorngren Posts: 22,044Questions: 26Answers: 5,083
    edited June 7

    I built a simple test case using the German language file, autoWidth off and the xhr event to remove the row data to result in No data available in table being shown.
    https://live.datatables.net/socirone/65/edit

    Inspecting the row it uses colspan="6" to match the number of columns in the table.

    How are you refreshing the table display?

    Please provide a link to your page or a test case replicating the issue so we can help debug. Feel free to update my test case.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • elstupidelstupid Posts: 2Questions: 1Answers: 0

    Thanks Kevin

    I can't provide a live example, because everything is hidden behind a corporate website with a login. Also to replicate is not very easy because I have split up a lot of the initialization stuff for many datatables, which would mean I have to include lots of js also.

    However thinking about it, the problems happens every time on a page with tabs, where a datatable is initalized on a tab. The first empty dt on a hidden tab is displaying correctly when made visible, but a second one on another tab isn't. So my guess is, it's not setup correctly when it's container is not visible. In that case, my colspan is set to 0 and after a page refresh with F5 (when the tab remains visible), it displays correctly.

    I tried to replicate it in your example, but that seems to work just fine. So it's an edge case for sure, I will try to find out what is happening.

  • kthorngrenkthorngren Posts: 22,044Questions: 26Answers: 5,083

    I can't provide a live example, because everything is hidden behind a corporate website with a login.

    If you can provide login details you can coordinate with Allan via PM to provide access.

    The first empty dt on a hidden tab is displaying correctly when made visible, but a second one on another tab isn't.

    Tried that here with BS 5 and it seems to work:
    https://live.datatables.net/sizivupi/1/edit

    Although its difficult to troubleshoot screenshots maybe you can right click and inspect the tr displaying the short No data available in table indication. Maybe something will standout for @allan .

    Kevin

  • allanallan Posts: 64,604Questions: 1Answers: 10,683 Site admin

    The code might give an indication, but I suspect it will just show the colspan not set correctly. I'd need to be able to put a debugging break point on it when it sets the colspan to see why the calculation for it might be wrong. Without a test case showing the issue I doubt I'll be able to offer much help I'm afraid.

    Allan

Sign In or Register to comment.