Jquery Datatable 数据填充报错:requested unknown parameter 'XXX' for row xx, column xx 解决方法
2016-09-23 16:10
429 查看
报错如图:
![](https://img-blog.csdn.net/20160923155758880?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
解决方法见官网:https://datatables.net/manual/tech-notes/4
摘要如下:
When
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
the
the table, which is not supported by DataTables.
Using
have specified more columns than there are in the HTML
The number of cells in the table does not satisfy the equation
在我的代码里就是这种情况,参数为Integer 类型。还有参数为:String 、 function 类型的见官网解决方法。
解决方法摘要如下 :
Resolution
The key to resolving this error, is to ensure that DataTables has all of the data that is required. Specifically, check the following:
not been used in the
the table.
The equation
If using
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
that they are returning a value (no return in Javascript is the same as returning
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.
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
With
any
will be replaced with the value specified. No warning will be shown in this circumstances.
官网解决 例子:https://datatables.net/reference/option/columns.defaultContent
摘要如下:
![](https://img-blog.csdn.net/20160923160541079?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
这个例子对于我这种情况(参数为Integer 且为 null )的解决方法就是给该值设置 默认值。 如图在代码中加上 " defaultContent " : " " 就OK了。默认值的具体内容可以自由设置。
解决方法见官网: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
colspanor
rowspanin
the
tbodyof
the table, which is not supported by DataTables.
Using
columnsor
columnDefsyou
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).
在我的代码里就是这种情况,参数为Integer 类型。还有参数为:String 、 function 类型的见官网解决方法。
解决方法摘要如下 :
Resolution
The key to resolving this error, is to ensure that DataTables has all of the data that is required. Specifically, check the following:
colspanand
rowspanhave
not been used in the
tbodyof
the table.
The equation
#cells = #columns * #rowsis satisfied.
If using
columnsensure
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.renderor
columns.dataensure
that they are returning a value (no return in Javascript is the same as returning
undefinedwhich
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
nulland
undefinedvalues
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.defaultContentoption.
With
columns.defaultContentset,
any
nullor
undefinedvalue
will be replaced with the value specified. No warning will be shown in this circumstances.
官网解决 例子:https://datatables.net/reference/option/columns.defaultContent
摘要如下:
这个例子对于我这种情况(参数为Integer 且为 null )的解决方法就是给该值设置 默认值。 如图在代码中加上 " defaultContent " : " " 就OK了。默认值的具体内容可以自由设置。
相关文章推荐
- [dataTables使用的坑]requested unknown parameter 'XXX' for row xx, column xx
- mysql Data too long for column ‘xxx’ at row xxx的解决方法
- MySql 弹出“data too long for column 'xxx' at row 1"解决方法
- mysql Data too long for column ‘xxx’ at row xxx的解决方法
- 解决Load Data infile时Incorrect integer value: '' for column 'id' at row 1的方法
- 读取MYSQL中文数据乱码,解决data too long for column 'title' at row 1
- DataTables warning: table id=dataTable - Requested unknown parameter 'acceptId' for row 0. For more
- mySQL中"Data truncated for column xxx" 解决方法
- DataTables warning : Requested unknown parameter '1' from the data source for row 0错误
- ERROR 1366 (HY000): Incorrect string value:’XXX’ for column 'XXX at row 1解决
- ERROR 1366 (HY000): Incorrect string value:’XXX’ for column 'XXX at row 1解决
- 读取MYSQL中文数据乱码,解决data too long for column 'title' at row 1
- 中文写入数据库乱码及Incorrect string value: '\xF0\x9F...' for column 'XXX' at row 1解决
- mysql下出现Unknown column 'xx' in 'on clause'的完全解决方法
- 解决Incorrect integer value: '' for column 'id' at row 1的方法
- 解决Incorrect integer value: '' for column 'id' at row 1的方法
- 解决Incorrect integer value: '' for column 'id' at row 1的方法
- 解决Incorrect integer value: '' for column 'id' at row 1的方法
- DataTables warning : Requested unknown parameter '1' from the data source for row 0错误
- 中文写入数据库乱码及Incorrect string value: '\xF0\x9F...' for column 'XXX' at row 1解决