Wizard Wizard - 18 days ago 9
HTML Question

jQuery DataTables error - TypeError: Cannot read property 'fnInit' of undefined

I'm getting this error:


Uncaught TypeError: Cannot read property 'fnInit' of undefined


jquery.dataTables.js:2872

DataTable.ext.oPagination[ oSettings.sPaginationType ].fnInit( oSettings, nPaginate,
function( oSettings ) {
_fnCalculateEnd( oSettings );
_fnDraw( oSettings );
}
);


Table is placed properly, I think, that problem is not in HTML.

Answer

CAUSE

It seems that the problem is that you used not supported value for sPaginationType or pagingType option.

SOLUTION

DataTables 1.10

Option pagingType supports the following values by default:

  • numbers - Page number buttons only (1.10.8+)
  • simple - 'Previous' and 'Next' buttons only
  • simple_numbers - 'Previous' and 'Next' buttons, plus page numbers
  • full - 'First', 'Previous', 'Next' and 'Last' buttons
  • full_numbers - 'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers

DataTables 1.9

Option sPaginationType supports the following values by default:

  • two_button- 'Previous' and 'Next'
  • full_numbers - 'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers