After upgrade to 3.0.1 error : s.match is not a function stringToCss
After upgrade to 3.0.1 error : s.match is not a function stringToCss
Link to test case: https://liveresults2.kitst.co.uk/#coll1km26.csv
Debugger code (debug.datatables.net):
old page onecom
new page Upload does not get past Gathering data
Error messages shown:
jQuery.Deferred exception: s.match is not a function stringToCss@https://liveresults2.kitst.co.uk/js/datatables/datatables.js:83109:14
Description of problem:
I upgraded from 2.1.8 to 3.0.1 and get the above error
The original site with 2.1.8 is here: https://liveresults.kitst.co.uk/#coll1km26.csv
Thanks
Ted
tfcroft4
Replies
Hi Ted,
Is the problem. It should be a string value - see
scrollY. I think it can actually be a number as well, I'll check that, but a boolean doesn't tell DataTables how high it should be.That it worked in 2.x is a fluke, it hasn't been documented that it could be a boolean value before. If you update it to be whatever the height is that you want, that will fix the issue.
Allan
update - If I disable loading jquery then I get the following errors:
Bootstrap and responsive need jquery?
Uncaught Error: Bootstrap's JavaScript requires jQuery
<anonymous> https://liveresults2.kitst.co.uk/js/bootstrap.min.js:6
bootstrap.min.js:6:37
Uncaught ReferenceError: jQuery is not defined
<anonymous> https://liveresults2.kitst.co.uk/js/responsive/responsive.min.js:2
responsive.min.js:2:5683
Uncaught ReferenceError: jQuery is not defined
<anonymous> jQuery
jquery_csv_min.js:73:167
Uncaught ReferenceError: $ is not defined
<anonymous> https://liveresults2.kitst.co.uk/#coll1km26.csv:248
liveresults2.kitst.co.uk:248:1
Uncaught ReferenceError: $ is not defined
<anonymous> https://liveresults2.kitst.co.uk/#coll1km26.csv:569
liveresults2.kitst.co.uk:569:1
<anonymous> https://liveresults2.kitst.co.uk/#coll1km26.csv:569
InstallTrigger is deprecated and will be removed in the future.
Thanks
Ted
Depends which version of Bootstrap. v3 and 4 have jQuery as a hard dependency. v5 does not require jQuery although provides a bridge, and my understanding is that v6 (when it happens) won't even provide the bridge.
Looks like your site is using Bootstrap 3, so yes, you would still need to load jQuery.
My Responsive extensions for DataTables does not require jQuery as of Responsive v4.
Allan
changing
return s.match(/\d$/) ?
s+'px' :
s;
to
return String(s).match(/\d$/) ?
s+'px' :
s;
seems to resolve this ref: https://stackoverflow.com/questions/46253553/datatables-s-match-is-not-a-function
This seems to be a hack. Is there an official resolution?
Thanks
Ted
Hi Ted,
Did you see my reply above about
scrollY? That's the solution.Allan