Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 804
Wizard Avatar asked Jun 16 '14 12:06

Wizard


1 Answers

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
like image 124
Gyrocode.com Avatar answered Sep 21 '22 12:09

Gyrocode.com