javascript jQuery DataTables 错误 - TypeError:无法读取未定义的属性“fnInit”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24244353/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
jQuery DataTables error - TypeError: Cannot read property 'fnInit' of undefined
提问by Wizard
I'm getting this error:
我收到此错误:
Uncaught TypeError: Cannot read property 'fnInit' of undefined
未捕获的类型错误:无法读取未定义的属性“ fnInit”
jquery.dataTables.js:2872
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.
表格放置正确,我认为,问题不在 HTML 中。
回答by Gyrocode.com
CAUSE
原因
It seems that the problem is that you used not supported value for sPaginationType
or pagingType
option.
似乎问题在于您使用了不支持的值sPaginationType
或pagingType
选项。
SOLUTION
解决方案
DataTables 1.10
数据表 1.10
Option pagingType
supports the following values by default:
OptionpagingType
默认支持以下值:
numbers
- Page number buttons only (1.10.8+)simple
- 'Previous' and 'Next' buttons onlysimple_numbers
- 'Previous' and 'Next' buttons, plus page numbersfull
- 'First', 'Previous', 'Next' and 'Last' buttonsfull_numbers
- 'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers
numbers
- 仅限页码按钮 (1.10.8+)simple
- 仅“上一个”和“下一个”按钮simple_numbers
- “上一个”和“下一个”按钮,以及页码full
- “第一个”、“上一个”、“下一个”和“最后一个”按钮full_numbers
-“第一个”、“上一个”、“下一个”和“最后一个”按钮,以及页码
DataTables 1.9
数据表 1.9
Option sPaginationType
supports the following values by default:
OptionsPaginationType
默认支持以下值:
two_button
- 'Previous' and 'Next'full_numbers
- 'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers
two_button
- “上一个”和“下一个”full_numbers
-“第一个”、“上一个”、“下一个”和“最后一个”按钮,以及页码