Firebug 中的数据表警告
所以我有一个由用户输入填充的数据表。当我进入屏幕时(在提交任何内容之前),我不会在萤火虫中发出任何警告。当我在表中输入一些内容并提交后。我自动返回到同一页面,只有表格中有我提交的信息。此时我遇到了错误。看起来
DataTables warning (table id = 'table'): Unexpected number of TD elements. Expected 5
and got 6. DataTables does not support rowspan / colspan in the table body, and there
must be one cell for each row/column combination.
很明显,但我的桌子上没有 rowspan 或 colspan。所以我不知道问题是什么。另外,这是我对数据表的设置:
var table1 = {};
table1 = O_LANGUAGE = {sEmptyTable: "There is nothing here."};
$(document).ready(function() {
var $table= $("#table");
$table.dataTable({
"aaSorting": [ [0,'desc'] ], "oLanguage" : bsFaReq.O_LANGUAGE, "bLengthChange": false, "bFilter": false, "bAutoWidth": false, "bInfo": false, "bPaginate": false
});
好的,所以它运行良好,但在修复此警告之前我无法将其发布,感谢任何帮助,提前谢谢您。
So I have a datatable that is being populated by user inputs. When I enter the screen (before I submit anything) I dont throw any warnings in firebug. After I enter something into the table and submit. I automatically get returned to the same page, only the table has my submitted information in it. At this point is when I am getting the error. Here it is:
DataTables warning (table id = 'table'): Unexpected number of TD elements. Expected 5
and got 6. DataTables does not support rowspan / colspan in the table body, and there
must be one cell for each row/column combination.
Seems obvious, but I dont have rowspan or colspan on my table. So I dont know what the problem is. Also, here is my setup for the datatable:
var table1 = {};
table1 = O_LANGUAGE = {sEmptyTable: "There is nothing here."};
$(document).ready(function() {
var $table= $("#table");
$table.dataTable({
"aaSorting": [ [0,'desc'] ], "oLanguage" : bsFaReq.O_LANGUAGE, "bLengthChange": false, "bFilter": false, "bAutoWidth": false, "bInfo": false, "bPaginate": false
});
OKay, so it runs fine, but I cant put it out until I get this warning fixed, any help is appreciated, thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是因为您的表中有 5 列,但发送的数据为 6 列。
It's because the there are 5 columns in Your table but data is sent for 6.
我认为你必须调试第一个警告,即“预期 5 个,得到 6 个”,这意味着你试图添加 6 个 td,而上面的行只有 5 个。
I think you have to debug the first warning which is "Expected 5 and got 6" which means you are trying to add 6 td's while the rows above were 5 only.