Uncaught TypeError: Cannot set property '_DT_CellIndex' of undefined
Uncaught TypeError: Cannot set property '_DT_CellIndex' of undefined
I know this has been asked many times, but it seems that none of the solutions has worked for me. I am using C# and ASP.NET to build a page with several GridViews. The first three load fine with DataTables working as it should. However, I have one grid that just displays as it normally would without DataTables. Below is a link to the HTML output that seems to work fine in the DataTables test system. I get no error on this site, but locally I get the error "Uncaught TypeError: Cannot set property '_DT_CellIndex' of undefined". There are no other errors in JS or other code either.
This question has an accepted answers - jump to answer
Answers
OK seems the issue is actually with the previous table that has no data in it, but displays properly. Now to figure out why that grid is throwing the error.
http://live.datatables.net/tepuvafi/1/edit
So it would seem that any ASP.NET GridView that is empty fails to work with DataTables. Any ideas on a fix? Workaround? If I cannot get this working on all grids, I have to move to another option.
DataTables doesn't support
colspan
orrowspan
in the table body I'm afraid. That's where the error is coming from. If there are no results for a table, just use a completely emptytbody
. DataTables will show its "No records" message.Allan