DataTables CSS doesn't always fire up

DataTables CSS doesn't always fire up

cbarrettcbarrett Posts: 9Questions: 2Answers: 1
edited July 2017 in Free community support

Hello,

My DataTables CSS doesn't always fire up. I know my click event works, because the JSON I'm parsing is returning data in the table, but the table itself does not have CSS. This issue happens sporadically and I've been unable to pinpoint the issue. I've read that it could be CSS clashing, but I'm not absolutely sure.

I've attached four images; two are images of it not working(mobile and desktop) and two are what it looks like when the CSS is working(Desktop and mobile).

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,592Questions: 26Answers: 5,006

    When the table doesn't load correctly have you looked at the console for errors?

    If there a javascript or other error then the table might not fully load.

    Kevin

  • cbarrettcbarrett Posts: 9Questions: 2Answers: 1

    Yes, I looked at the console and no errors are popping up.

  • kthorngrenkthorngren Posts: 21,592Questions: 26Answers: 5,006

    Can you post a link to a page showing the issue?

    Kevin

  • cbarrettcbarrett Posts: 9Questions: 2Answers: 1
    edited July 2017

    cloud.iowadot.gov/Highway/weatherview/

    Click on a point, then click on the forecast tab.

  • cbarrettcbarrett Posts: 9Questions: 2Answers: 1
    Answer ✓

    I figured it out. It's not a datatables issue. It's actually a DOJO issue.

  • HC777HC777 Posts: 2Questions: 0Answers: 0

    Yo could use something similar to this example: https://datatables.net/reference/api/destroy()

  • cbarrettcbarrett Posts: 9Questions: 2Answers: 1

    my issue revolved around what element I wanted to use as the click event location:

    $(document).ready(function () {
            $('body').on('click', '.dijitTab', function () {
                renderDataTable();
            });
        });
    

    I instead had '.tabLabel' instead of .dijitTab, so when you click on the tab but not on the label, the DataTable wouldn't load all the way.

This discussion has been closed.