Datatables no longer displaying
Datatables no longer displaying
As of a few weeks ago, Our data tables are no longer showing up.
Here is the Debug log from the console
Debugger code (debug.datatables.net):
DT_Debug.js?rand=1680265182598:460 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at Object.default_1 [as info] (DT_Debug.js?rand=1680265182598:460:25)
at HTMLDivElement.<anonymous> (DT_Debug.js?rand=1680265182598:97:25)
at HTMLDivElement.dispatch (jquery.min.js?ver=3.6.3:2:43184)
at y.handle (jquery.min.js?ver=3.6.3:2:41168)
default_1 @ DT_Debug.js?rand=1680265182598:460
(anonymous) @ DT_Debug.js?rand=1680265182598:97
dispatch @ jquery.min.js?ver=3.6.3:2
y.handle @ jquery.min.js?ver=3.6.3:2
DT_Debug.js?rand=1680265182598:978 Uncaught TypeError: Cannot read properties of undefined (reading 'FixedHeader')
at Object.fn (DT_Debug.js?rand=1680265182598:978:24)
at Object.default_1 [as common] (DT_Debug.js?rand=1680265182598:413:43)
at HTMLDivElement.<anonymous> (DT_Debug.js?rand=1680265182598:97:25)
at HTMLDivElement.dispatch (jquery.min.js?ver=3.6.3:2:43184)
at y.handle (jquery.min.js?ver=3.6.3:2:41168)
Answers
Please provide a working test case, as per the forum rules.
https://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read#latest
The page is private but I can share a screenshot
(https://datatables.net/forums/uploads/editor/7t/2kzdviexy1ce.png )
are a screenshot
That seems to be a different error:
This SO thread discusses the error. Maybe it will help.
Many times this is due to differences in the number of HTML columns defined and the
columns
option. However there could be many reasons for this. Maybe you can provide a simple test case that replicates the issue.https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Thanks for the help. We did recently Upgraded our PHP from 7.0 to 8.2. Could this be the conflict?
It seems likely if that is the only thing that has changed. However, and the others have indicated, it is very difficult to debug this without being able to see it. Are you Ajax loading data for example? If so, what is the response from the server?
Allan
I have these for examples
https://live.datatables.net/pusevexe/1/edit
https://live.datatables.net/pusevexe/1
I added these as page examples that are running the errors. Let me know if you can view them
Your example doesn't include the DataTables or jQuery Javascript files. Including them stops that error, but it doesn't do much else since the test case isn't complete. The page isn't valid HTML, there is PHP code in there and there is no DataTable called #example.
I'd really like to help, but without being able to see your page or a test case that exactly replicates your page, there isn't a huge amount of help I can offer. My apologies!
Allan
No worries. Thanks for attempting to help. I inherited this project and I'm trying my attempt to fix it.
Are you Ajax loading data for example? Yes
If so, what is the response from the server?" How do I find that out?
See this tech note.
Allan