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

问题:DataTables warning: Requested unknown parameter ‘0‘ from the data source for row ‘0‘

代码:

<script type="text/javascript">

var data = [
    {"Name":"UpdateBootProfile","Result":"PASS","ExecutionTime":"00:00:00","Measurement":[]},
    {"Name":"NRB Boot","Result":"PASS","ExecutionTime":"00:00:50.5000000","Measurement":[{"TestName":"TOTAL_TURN_ON_TIME","Result":"PASS","Value":"50.5","LowerLimit":"NaN","UpperLimit":"NaN","ComparisonType":"nctLOG","Units":"SECONDS"}]},
    {"Name":"NvMgrCommit","Result":"PASS","ExecutionTime":"00:00:00","Measurement":[]},
    {"Name":"SyncNvToEFS","Result":"PASS","ExecutionTime":"00:00:01.2500000","Measurement":[]}
];

$(function() {
        var testsTable = $(‘#tests‘).dataTable({
                bJQueryUI: true,
                aaData: data,
                aoColumns: [
                        { mData: ‘Name‘ },
                        { mData: ‘Result‘ },
                        { mData: ‘ExecutionTime‘ },            { mData: ‘localtion‘ }
] }); }); </script>

报错原因: 这个location字段,有数据的时候出现,没有数据的时候,就成这个样子了

   aoColumns: [
                        { mData: ‘Name‘ },
                        { mData: ‘Result‘ },
                        { mData: ‘ExecutionTime‘ }导致页面错误。

改正的方法是:1.$(‘#example‘).dataTable( {

  "columns": [

    null,

    null,

    null,

    {

      "data""office"// can be null or undefined

      "defaultContent"""

    }

  ]

} );  加上【"defaultContent"""

2. 用都是数组的形式

var data = [
    ["UpdateBootProfile","PASS","00:00:00",[]] ,
    ["NRB Boot","PASS","00:00:50.5000000",[{"TestName":"TOTAL_TURN_ON_TIME","Result":"PASS","Value":"50.5","LowerLimit":"NaN","UpperLimit":"NaN","ComparisonType":"nctLOG","Units":"SECONDS"}]] ,
    ["NvMgrCommit","PASS","00:00:00",[]] ,
    ["SyncNvToEFS","PASS","00:00:01.2500000",[]]
];

解决链接:https://datatables.net/manual/tech-notes/4https://datatables.net/reference/option/columns.defaultContenthttp://stackoverflow.com/questions/16539578/datatables-warning-requested-unknown-parameter-0-from-the-data-source-for-row

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

时间: 2024-12-22 08:55:12

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

DataTables warning : Requested unknown parameter &#39;1&#39; from the data source for row 0错误

昨天在做datatables的项目,从后台取得数据后,返回给datatables界面时会报下面的错误: DataTables warning : Requested unknown parameter '1' from the data source for row 0 加上下面的设置就可以了,至于原理还不是很清楚. "aoColumnDefs": [{ sDefaultContent: '', aTargets: [ '_all' ]  }], var oTable = $(&quo

DataTables warning : Requested unknown parameter &#39;0&#39; from the data source for row 0错误

在做datatables的项目,从后台取得数据后,返回给datatables界面时会报下面的错误: DataTables warning : Requested unknown parameter '0' from the data source for row 0 加上下面的设置就可以了,至于原理还不是很清楚. "aoColumnDefs": [{ sDefaultContent: '', aTargets: [ '_all' ]  }], var oTable = $("

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

昨天在做 Jquery DataTables 的时候,遇到的一个问题,我使用MVC,在tables上加入了一个actionlink的href.但是在运行起来的时候,报错: DataTables warning: Requested unknown parameter '3' from the data source for row 0 通过search一下网上大神们的解决方法,所以我就把blogs上的解决方法给copy过来了,这是原文链接地址 http://seaboycs.iteye.com/

DataTables warning: TABLE id=DataTables_Table_0 - Requested UNKNOWN parameter &#39;7&#39; FOR ROW 0

使用H-ui.admin或者DataTables的人都难免会碰到: DataTables warning: TABLE id=DataTables_Table_0 - Requested UNKNOWN parameter '7' FOR ROW 0. FOR more information about this error, please see http://datatables.net/tn/4 此错误,结果去了DataTables官网手册也没看懂怎么解决. 耐着着急的赶项目的心,仔细去

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 more information about this error, please see http://datatables.net/tn/4 使用jquery.datatable时发生上面错误,配置如下: table = $("#dataTable").dataTable({ &quo

DataTables warning: table id=data-table - Requested unknown parameter &#39;3&#39; for row 0.

本文为博主原创,未经允许,不得转载: 在使用jquery 的datatable时,报错在页面弹出弹出框,并提示以下内容: DataTables warning: table id=data-table - Requested unknown parameter '3' for row 0. For more information about this error, please see http://datatables.net/tn/4 错误原因: 在进行列展示的时候,未能解析出对应的值,然

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

同样是PHP版本问题:in_array()函数 第二个参数应该为数组 但是 lnmp下,PHP5.3不报错,wamp下PHP5.5报以下错误: echo "<br>For in_array:"; $arrstr="weibhd1"; if(in_array("weibhd1",$arrstr)) { echo "ok!"; }else{ echo "no!"; } ( ! ) Warning:

解决FATAL: Error inserting ip_vs ... Unknown symbol in module, or unknown parameter

在使用yum install ipvsadm -y安装lvs管理工具后,发现指令ipvsadm相关指令一直报错: FATAL: Error inserting ip_vs (/lib/modules/2.6.32-358.18.1.el6.x86_64/kernel/net/netfilter/ipvs/ip_vs.ko): Unknown symbol in module, or unknown parameter (see dmesg) Can't initialize ipvs: Prot

org.apache.ibatis.binding.BindingException: Parameter &#39;start&#39; not found. Available parameters are [1, 0, param1, param2]

DEBUG 2018-05-30 08:43:26,091 org.springframework.jdbc.datasource.DataSourceTransactionManager: Rolling back JDBC transaction on Connection [[email protected]]DEBUG 2018-05-30 08:43:26,091 org.mybatis.spring.SqlSessionUtils$SqlSessionSynchronization: