Backwards Incompatibility (scrollX feature)

Backwards Incompatibility (scrollX feature)

benjaminbaldonibenjaminbaldoni Posts: 11Questions: 3Answers: 1
edited September 2015 in Free community support

Hi Allan, I updated to the latest version of DTT and i'm having a problem when creating a table with scrollX, it throws the following error: Uncaught TypeError: s.match is not a function at line 4439 on this build https://cdn.datatables.net/r/dt/dt-1.10.8,b-1.0.2,b-colvis-1.0.1,b-html5-1.0.1,fc-3.1.0,fh-3.0.0,se-1.0.1/datatables.js

This are the DTT settings:

$.extend($.fn.dataTable.defaults, { 
    'scrollX': true 
});
$('table').DataTable(data);

Where "data" is Object {asColumnSemantics: Array[32], aoColumns: Array[32], aaTotals: Array[32], aaData: Array[5]}

The strange thing is that this will work just fine if I use a previous (DataTables 1.10.4) version.

Sorry I can't provide you with a live example, if you can't figure out the issue i'll try to reproduce it in a fiddle in the next few days.

I disabled the scrollX feature by now, it's just a nice to have for me. Let me know if you find something. Thanks!

Replies

  • mymainmanbrownmymainmanbrown Posts: 1Questions: 0Answers: 0

    I ran into this same issue recently, and for me, it was due to the fact that a boolean was used for scrollX / scrollY. The root of the problem seems to stem from the "_fnPrintScrollEnd" method of datatables-tabletools.js. This method only checks for empty string values of oScroll.sX and oScroll.sY, which are the settings that come from the scrollX and scrollY initialization options. Since boolean values are not filtered out, when _fnStringToCss attempts to run s.match() where s is a boolean, it fails.

    I was able to work around this problem by setting scrollX and scrollY to "100%", which appears to have the same effect as using a boolean value, whether true or false.

    Hope this helps!

  • allanallan Posts: 63,427Questions: 1Answers: 10,457 Site admin

    This should have been fixed by this commit two weeks ago. It isn't available in a release version yet, but it will be in 1.10.10 and is in the current nightly version.

    Allan

This discussion has been closed.