Jquery Datatable 数据填充报错:requested unknown parameter 'XXX' for row xx, column xx 解决方法
来源:互联网 发布:ubuntu桌面版 编辑:程序博客网 时间:2024/05/20 09:05
报错如图:
解决方法见官网:https://datatables.net/manual/tech-notes/4
摘要如下:
Parameter is an integer
When {parameter}
is an integer, DataTables is looking for data from an array. This is usually the case when using DOM sourced data (i.e. the data for the table is read automatically from the document). In this circumstance the requested data doesn't exist in source array - likely because the array isn't long enough. This can occur if:
- There is a
colspan
orrowspan
in thetbody
of the table, which is not supported by DataTables. - Using
columns
orcolumnDefs
you have specified more columns than there are in the HTML - The number of cells in the table does not satisfy the equation
#cells = #columns * #rows
(i.e. there are more columns defined in the header than in the table body, or vice-versa).
解决方法摘要如下 :
Resolution
The key to resolving this error, is to ensure that DataTables has all of the data that is required. Specifically, check the following:
colspan
androwspan
have not been used in thetbody
of the table.- The equation
#cells = #columns * #rows
is satisfied. - If using
columns
ensure that you have specified exactly the number of columns that are present in the HTML for the table. - Also if using `dt-init columns, remove any trailing commas you might have at the end of the array. The additional comma can cause issues for older browsers.
- If using dt-init columnDefs` ensure that you have not specified more columns than there are in the HTML
- If using
columns.render
orcolumns.data
ensure that they are returning a value (no return in Javascript is the same as returningundefined
which will result in this error). - Ensure that the server-side script is completing its execution successfully. Long running scripts can time out for example. The server error logs will give an indication if this is the case.
null
or undefined
data
null
and undefined
values in a data source absolutely are valid and very often useful. DataTables warns about the use of them by default, as the majority of the time they are not intended for display - for example, rather than showing null in the table, you might want to show Not yet set, or simply an empty string (empty cell). For this, DataTables has a columns.defaultContent
option.
With columns.defaultContent
set, any null
or undefined
value will be replaced with the value specified. No warning will be shown in this circumstances.
官网解决 例子:https://datatables.net/reference/option/columns.defaultContent
摘要如下:
- Jquery Datatable 数据填充报错:requested unknown parameter 'XXX' for row xx, column xx 解决方法
- [dataTables使用的坑]requested unknown parameter 'XXX' for row xx, column xx
- jquery datatables之Requested unknown parameter '' for row column
- DataTables Requested unknown parameter 'id' for row 0, column 0.
- DataTables warning: table id=dataTable - Requested unknown parameter 'acceptId' for row 0. For more
- DataTables warning : Requested unknown parameter '1' from the data source for row 0错误
- datatables 1.9 自定义列?Requested unknown parameter '4' from the data source for row 0
- DataTables warning : Requested unknown parameter '1' from the data source for row 0错误
- DataTables warning : Requested unknown parameter '1' from the data source for row 0
- DataTables warning: table id=DataTables_Table_0 - Requested unknown parameter '5' for row 0.解决方案
- dataTables错误:DataTables warning : Requested unknown parameter '1' from the data source for row 0
- DataTables warning (table id = '***'): Requested unknown parameter '*' from the data source for row
- 【Java+Maven】问题系列——Maven 报错 Missing artifact xxx:xxx:bundle:xx.xx.xx
- XML文件报错dubbo:XX解决方法
- XML文件报错dubbo:XX解决方法
- ResultSet can not re-read row data for column XX 错误及其原因
- MySQL中导入中文字符解决方案[Data too long for column XX at row n]
- MySQL中文字符解决方案[Data too long for column XX at row n]
- 理解OAuth 2.0
- 深度学习框架可使用组件化的思考&BP反向传播的思考
- Android性能优化之一:ViewStub
- ODI环境搭建_04安装Oracle Data Integrator
- ViewPager的使用<一>
- Jquery Datatable 数据填充报错:requested unknown parameter 'XXX' for row xx, column xx 解决方法
- 话一:Wince开发之软硬件需求
- SDLockView:基于贝塞尔曲线的手势解锁
- jQuery插件开发精品教程
- django1.10的很多操作跟现在出版的书里的命令都不一样了
- 寄存器用法惯例
- android 放大镜 Magnifier 简单实现
- php中文件上传$_FILES 的错误代码
- android 索引的实现