在做datatables的项目,从后台取得数据后,返回给datatables界面时会报下面的错误:

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

加上下面的设置就可以了,至于原理还不是很清楚。

"aoColumnDefs": [
{
 sDefaultContent: '',
 aTargets: [ '_all' ]
  }
],

var oTable = $("#example").dataTable({
    "bDeferRender" : true,
    "bFilter" : false,
    "bDestroy" : true,
    "bProcessing" : true,
    "bSort" : true,
    "bStateSave" : false,
    // 异步处理必须 否则数据发送不到后来
    "bServerSide" : true,
    "sServerMethod" : "POST",
 
    "sAjaxSource" : "${basePath}/logInfo/getLogInfo",
 
    "aoColumns" : [ {
        "bVisible" : true,
        "mData" : "providerName",
        "aTargets" : [ 0 ]
    }, {
        "bVisible" : true,
        "mData" : "propertyName",
        "aTargets" : [ 1 ]
    }, {
        "bVisible" : true,
        "mData" : "roomTypeName",
        "aTargets" : [ 2 ]
    }, {
        "bVisible" : true,
        "mData" : "opMethod",
        "aTargets" : [ 3 ]
    }, {
        "bVisible" : true,
        "mData" : "operatTime",
        "aTargets" : [ 4 ]
    }, {
        "bVisible" : true,
        "mData" : "operator",
        "aTargets" : [ 5 ]
    }, ],
    "aoColumnDefs" : [ {
        sDefaultContent : '',
        aTargets : [ '_all' ]
    } ],
 
    "oLanguage" : {
        "sProcessing" : "正在加载中......",
        "sLengthMenu" : "每页显示 _MENU_ 条记录",
        "sZeroRecords" : "没有数据!",
        "sEmptyTable" : "表中无数据存在!",
        "sInfo" : "当前显示 _START_ 到 _END_ 条,共 _TOTAL_ 条记录",
        "sInfoEmpty" : "显示0到0条记录",
        "sInfoFiltered" : "数据表中共为 _MAX_ 条记录",
        "oPaginate" : {
            "sFirst" : "首页",
            "sPrevious" : "上一页",
            "sNext" : "下一页",
            "sLast" : "末页"
        }
    }
 
});

转:http://www.cnblogs.com/VincentHome/p/3964798.html

DataTables warning : Requested unknown parameter '0' from the data source for row 0错误的更多相关文章

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

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

  2. DataTables warning requested unknown parameter

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

  3. 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 ...

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

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

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

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

  6. DataTables warning: table id=dataTable - Requested unknown parameter &#39;acceptId&#39; for row 0. For more

    重点内容 DataTables warning: table id=dataTable - Requested unknown parameter 'acceptId' for row 0. For ...

  7. 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

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

  8. Warning: in_array() expects parameter 2 to be array, string given in D:\wamp\www\suiji.php on line 26

    可参考上篇文章  链接 PHP数组简写模式 同样是PHP版本问题:in_array()函数 第二个参数应该为数组 但是 lnmp下,PHP5.3不报错,wamp下PHP5.5报以下错误: echo & ...

  9. org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'username' not found. Available parameters are [1, 0, param1, param2]

    Spring+mybatis错误:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.bi ...

随机推荐

  1. 稀疏矩阵 part 5

    ▶ 目前为止能跑的所有代码及其结果(2019年2月24日),之后添加:DIA 乘法 GPU 版:其他维度的乘法(矩阵乘矩阵):其他稀疏矩阵格式之间的相互转化 #include <stdio.h& ...

  2. github 解决 Agent admitted failure to sign using the key

    公司迁移git 新库,重新迁移数据. 添加 ssh key  1. 首先要在新git 库管理平台 添加新的ssh-key : 本机上执行 ssh-keygen -t rsa -C "Your ...

  3. 使用 nodeJs 开发微信公众号(获取access_token)

    要使用微信提供的功能接口,就需要获取到access_token,这是开发公众号必不可少的一部 access_token有效期20分钟,建议保存起来,过期后在重新获取 获取流程如下: 我将微信相关的操作 ...

  4. Idea安装svn插件

    1. 首先要注意:TortoiseSVN在安装的时候没有command line,在安装TortoiseSVN时,要支持Idea需要点击叉的下拉单,选择will be installed local ...

  5. IDEA与eclipse:vm参数调优笔记

    我的电脑配置12G内存,64位,win10系统. 首先,idea,是在idea中安装目录下的bin目录下面找到位的同学注意找到idea32.exe.vmoptions的文件去编辑. 更改文件,无非大多 ...

  6. String(Java版本)

    import java.io.UnsupportedEncodingException; public class Driver { public static void main(String[] ...

  7. Mysql千万级大表优化

    Mysql的单张表的最大数据存储量尚没有定论,一般情况下mysql单表记录超过千万以后性能会变得很差.因此,总结一些相关的Mysql千万级大表的优化策略. 1.优化sql以及索引 1.1优化sql 1 ...

  8. UE4AI行为树笔记

  9. error: undefined reference to 'android::hardware::details::return_status::~return_status()'

    use hidl , make fail. reason is:missing libs:libbinder

  10. python学习Day9 内存管理

    复习 :文件处理 1. 操作文件的三步骤:-- 打开文件:此时该文件在硬盘的空间被操作系统持有 |  文件对象被应用程序持用 -- 操作文件:读写操作 -- 释放文件:释放操作系统对文件在硬盘间的持有 ...