I have a table that gets generated dynamically. When there is data in the table is sorts fine. However, when it runs into a table that doesn't have data in it the next time I try to load data I get the following error:
table.tBodies[0] is undefined [Break On This Error] totalCells = (tabl...Bodies[0].rows[0].cells.length) || 0,
What I'm doing is I have a bunch or tables listed on the left hand side of the screen. When I click on one I create a html table the contains the columns and then the data from that table. This issue only happens when I click on a table that only brings back the column names of the table (no data in table in database).
In my .ajax call that loads the table:
$("#tableData").tablesorter();
($("#tableContents").html(result));
$("#tableData").trigger("update");
$("#tableData").tablesorter();
Any ideas why I might be getting this error?