Uncaught TypeError: Cannot set property ‘_DT_CellIndex’ of undefined
This is an error I recently came across while I was trying to replace a spreadsheet that was being used as an existing data source in wpdatatables. When I went to replace the spreadsheet, I uploaded a new spreadsheet, and then when I clicked on Save Settings the screen showed the loading animation forever and it did not resolved. When I opened the inspector, I found the error above. When I researched, it seemed that this error was the result of having a mismatch between the number of headers and the number of columns in your data. I checked my files many times and did not find any mismatch. When I reloaded the table in the wpdatatables preview, it was missing a column.
Then I tried to create a new table with the same file, and it uploaded without issue.
After a number of tests I realized the issue. The original spreadsheet being used as a data source for the table had a header “date”. When I went to replace the spreadsheet, my header for the same column said “Date”. I think wpdatatables was seeing this as an additional column, and causing the error.
So, the lesson here is that if you are replacing an existing data source, the table headings are CaSe SenSiTive.