Wizard
Wizard

Reputation: 11265

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.

Upvotes: 13

Views: 18347

Answers (1)

Gyrocode.com
Gyrocode.com

Reputation: 58880

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

Upvotes: 36

Related Questions