重点内容

DataTables warning: table id=dataTable - Requested unknown parameter ‘acceptId’ for row 0. For more information about this error, please see http://datatables.net/tn/4

使用jquery.datatable时发生上面错误,配置例如以下:

table = $("#dataTable").dataTable({
"scrollY": "400px", //高度
"scrollX": true, //左右滚动栏
"ordering":false,//thead上的排序button
"bLengthChange": false,//分页条数选择button
"bProcessing": true,//显示载入中
"bInfo": false,//页脚信息显示
"searching":false,//搜索输入框显示
"sPaginationType": "full_numbers",//分页显示样式
"paging":true,//
"sAjaxSource": '<%= basePath %>sellcar/getSellCarOrderList',
"bProcessing" : true,
"bServerSide" : true,
"oLanguage": {
"sLengthMenu": "每页显示 _MENU_ 条",
"sZeroRecords": "没有找到符合条件的数据",
"sProcessing": "我也是醉了,正在载入数据...",
"sInfo": "当前第 _START_ - _END_ 条 共计 _TOTAL_ 条",
"sInfoEmpty": "没有有记录",
"sInfoFiltered": "(从 _MAX_ 条记录中过滤)",
"sSearch": "搜索:",
"oPaginate": {
"sFirst": "首页",
"sPrevious": "前一页",
"sNext": "后一页",
"sLast": "尾页"
}
},
"aoColumns": [
//{ "sDefaultContent": ' '},
{ "mData":"brandName",'sClass':'left',
"mRender":function(data,type,full) {
var cusId = full.customerId;
var sellNo = full.sellNo;
var content = "<td><input type='checkbox' name='batchAllocated' id='batchAllocated' value='"+cusId+"' sell_no='"+sellNo+"'></td>";
return content;
}
},
{ "mData":"brandId",
"mRender":function(data,type,full){
if(full.carBrand!=null){
return full.carBrand.brandName;
};
return "";
}
},
{ "mData":"serieId",
"mRender":function(data,type,full){
if(full.carSerie!=null){
return full.carSerie.serieName;
};
return "";
}
},
{ "mData":"customeId",
"mRender":function(data,type,full){
if(full.customer!=null){
return full.customer.userName;
};
return "";
}
},
{ "mData":"phoneNo"},
{ "mData":"createdFormat"},
{ "mData":"sellStatus",'sClass':'left',
"mRender":function(data,type,full) {
var sellStatus = full.sellStatus;
var content = "";
if(sellStatus==0){
content = "待估车";
}else if(sellStatus==10){
content = "估车成功";
if(full.recordStatus == "wlr"){
content = "估车成功,未录入";
}else if(full.recordStatus == "ylr"){
content = "已录入";
}
if(full.item !=null){
var item = full.item;
if(item.carStatus == "ysh"){
content = "通过审核";
if(item.carOnSale == 0){
content = "待上架";
}else if(item.carOnSale ==1){
content ="上架";
}else if(item.carOnSale == 2){
content = "下架";
}else if(item.carOnSale == 3){
content = "已售";
}else if(item.carOnSale == 4){
content = "申请下架";
}
}else if(item.carStatus =="dsh"){
content = "待审核";
}else if(item.carStatus == "wsh"){
content = "未通过审核";
}
}
}else if(sellStatus==20){
content = "又一次估车";
}else if(sellStatus == 30){
content = "估车失败。结束";
}else if(sellStatus == 40){
content = "无效信息";
}
return content;
}
},
{ "mData":"acceptId",
"mRender":function(data,type,full){
if(data !=null){
if(full.acceptUser !=null){
return full.acceptUser.userName;
}
}
}
},
{ "mData":"carStatus",'sClass':'left',
"mRender":function(data,type,full) {
var content = "<a href='javascript:void(0);' class='show_info' info_id='"+full.sellNo+"'>查看</a>";
return content;
}
},
{ "mData":"isAllocated",'sClass':'left',
"mRender":function(data,type,full) {
var isAllocated = full.isAllocated;
var content = "";
if(isAllocated==0){
content = "<a href='javascript:void(0);' class='change_info' info_id='"+full.sellNo+"' cus_id='"+full.customerId+"'>分配</a>";
}else{
content = "<a href='javascript:void(0);' class='change_info' info_id='"+full.sellNo+"' cus_id='"+full.customerId+"'>又一次分配</a>";
}
return content;
}
}],
// "bLengthChange": true,// 控制每页显示记录数
"iDisplayLength": 10, // 每页显示数量
"fnServerData" : function(sSource, aoData, fnCallback) {
$.ajax({
"type" : 'post',
"url" : sSource,
"dataType" : "json",
"data" : {
aoData : JSON.stringify(aoData),
searchData: JSON.stringify(searchData)
},
"success" : function(resp) {
fnCallback(resp);
var datas=resp.aaData;
},
error: function(resp){
}
});
}/* ,
"fnRowCallback": function(nRow, aData, iDisplayIndex) {
// 当创建了行。但还未绘制到屏幕上的时候调用,通经常使用于改变行的class风格,此处用于显示‘表格序号’
$('td:eq(0)', nRow).html(iDisplayIndex+1);
return nRow;
} */
});

提示acceptId找不到,解决方式:

{ "mData":"acceptId",
"mRender":function(data,type,full){
if(data !=null){
if(full.acceptUser !=null){
return full.acceptUser.userName;
}
}else{
return "";
}
}
}

在写mRender时,必须全部路径都要有返回值。做了空值推断,可是没有给返回值所以出现了上述错误。做个记录。以备兴许使用。

DataTables warning: table id=dataTable - Requested unknown parameter &#39;acceptId&#39; for row 0. For more的更多相关文章

  1. DataTables warning: table id=data-table - Requested unknown parameter '3' for row 0.

    本文为博主原创,未经允许,不得转载: 在使用jquery 的datatable时,报错在页面弹出弹出框,并提示以下内容: DataTables warning: table id=data-table ...

  2. DataTables warning (table id = 'myTable'): Requested unknown parameter '0' from the data source for row 0

    第一种方式:不用在js里设置列Html: <table id="myTable"> <thead> <tr> <th>Title-1 ...

  3. DataTables warning: table id=DataTables_Table_0 - Requested unknown parameter '1' for row 0. For more information about this error, please see http://datatables.net/tn/4

    今天在做后台的时候,考虑到会员模块和订单模块列表显示差不多,于是乎,偷了个懒,把会员列表显示页面的代码拷贝了过来,修改了一下,变成了订单模块.可是,在订单列表显示的时候老是报下面的错误,截图如下: 后 ...

  4. laravel框架中报错 DataTables warning: table id=xxx-table - Cannot reinitialise DataTable.

    laravel框架中报错 DataTables warning: table id=xxx-table - Cannot reinitialise DataTable. 分析: initializin ...

  5. Jquery DataTables warning : Requested unknown from the data source for row 0

    昨天在做 Jquery DataTables 的时候,遇到的一个问题,我使用MVC,在tables上加入了一个actionlink的href.但是在运行起来的时候,报错: DataTables war ...

  6. Vue+DataTables warning:table id=xxxx -Cannot reinitialize DataTable.报错解决方法

    问题描述: 使用DataTables来写列表,用vue来渲染数据,有搜索功能,每次点击搜索就会报错,如下图所示. 问题排查: 找了一系列原因,最后发现是我每次请求完数据之后都会添加分页功能,从而导致了 ...

  7. DataTables warning (table id = 'DataTables_Table_0');错误解决办法!

    这个错误是table表格引起的,我是将条件语句和<td>标签做了调整后,消除的,个人认为是数据缺失引起的.

  8. DataTables warning requested unknown parameter

    This is possibly the most cryptic warning message that DataTables will show. It is a short error mes ...

  9. DataTables warning : Requested unknown parameter '5' from the data source for row 0

    在该项目中我使用了jquery.dataTables.js来作为我的前端数据表格. 表格的官网地址:https://www.datatables.net/ 一.jsp部分代码片段如下: <tab ...

随机推荐

  1. SSAO + FXAA

    如今已经完毕了渲染器的屏幕空间环境光遮挡(SSAO)算法和FXAA高速反走样算法,等有时间就把当中的相关原理和当中遇到的问题进行总结发表.

  2. JavaScript 中对变量和函数声明提前的演示样例

    如题所看到的,看以下的演示样例(能够使用Chrome浏览器,然后F12/或者右键,审查元素.调出开发人员工具,进入控制台console输入)(使用技巧: 控制台输入时Shift+Enter能够中途代码 ...

  3. FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT

    FATAL ERROR in native method:JDWP No transports initialized,jvmtiError=AGENT_ERROR_TRANSPORT_INIT(19 ...

  4. 利用js在文本框末尾获得焦点

    function moveEnd(obj) { obj.focus(); var len = obj.value.length; if (document.selection) { var sel = ...

  5. Uva 12012 Detection of Extraterrestrial 求循环节个数为1-n的最长子串长度 KMP

    题目链接:option=com_onlinejudge&Itemid=8&page=show_problem&problem=3163">点击打开链接 题意: ...

  6. 每天一个JavaScript实例-tab标签切换

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  7. Android顶部粘至视图具体解释

    不知从某某时间開始,这样的效果開始在UI设计中流行起来了.让我们先来看看效果: 大家在支付宝.美团等非常多App中都有使用.要实现这个效果,我们能够来分析下思路: 我们肯定要用2个一样的布局来显示我们 ...

  8. 杂项-快捷键:Google浏览器常用快捷键

    ylbtech-杂项-快捷键:Google浏览器常用快捷键 1.返回顶部 1. Google浏览器,是一个由Google(谷歌)公司开发的开放原始码网页浏览器.该浏览器是基于其他开放原始码软件所撰写, ...

  9. java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getClassLoader")

    转自:https://blog.csdn.net/bluecard2008/article/details/80921682?utm_source=blogxgwz0 摘要: 今天在使用jetty做容 ...

  10. js最简单的-点击小图放大

    js最简单的-点击小图放大 标签(空格分隔): js <html> <body> <img class="imgview" src="{$v ...