Datatable is coming undefined, earlier it was working fine but suddenly it stopped
Datatable is coming undefined, earlier it was working fine but suddenly it stopped
this is how we are initializing the datatables, currently using datatable version 1.10.21 and jquery v3.6.2
this.elm.dataTable = this.elm.$table.DataTable({
paging: false,
searching: false,
ordering: false,
scrollX: false,
info: false,
bAutoWidth : false,
fixedHeader: {
header: true,
footer: false
},
responsive: {
details: true
},
columnDefs: [
{ targets: this.visibleColumnIndexes, visible: true},
{ targets: '_all', visible: false }
]
});
error: multiple issue is getting occurred, things are coming undefined.
Uncaught TypeError: Cannot read properties of undefined (reading 'column')
Uncaught TypeError: Cannot read properties of undefined (reading 'fixedHeader')
Uncaught (in promise) Warning: FixedHeader requires DataTables 2 or newer
as mentioned in last warning it is referencing to version 2 or latest but before fixedheader was working fine with version 1.10.21.
Answers
If you could link to a test case showing the issue, I'll be able to debug it and say what is going wrong.
Allan
https://www.bosch-home.com/de/produkte/produktvergleich?products=HNG6764S6,HNG6764B6,HSG636XS6,HMG776NB1,CSG656RB7
to get console error message, scroll down to get a undefined ixed header error and click on right button beside product to get a undefined column error
Thanks for the link!
I think the issue stems from a warning given further up in the console:
That is resulting in
this.elm.dataTable
being undefined and this an error when scrolling.You are using DataTables 1.10.21, but have loaded FixedHeader 4.0.0 which requires DataTables 2.
Are you using npm and a package bundler? What are the dependencies shown in your
package.json
for thedatatables.net*
packages?Allan
we are using it in bower v1.8.14
please? Some of the old packages had dependency versions that were too broad, and thus were bringing in newer, incompatible versions.
Thanks,
Allan
Previously, everything was functioning well with the same version for an extended period. Have there been any recent changes?
Thanks
Yes, DataTables 2 is now available. It might be something related to that, but without a test case or a way to reproduce the error you are seeing it is impossible to say for sure. Please provide a test git repo or a StackBltiz showing the error so I can offer some help to resolve the problem, beyond what I have already suggested.
Allan