简体   繁体   English

jQuery Datatables请求行'0'列'0'的未知参数'0'

[英]jQuery Datatables Requested unknown parameter '0' for row '0' column '0'

I have the flat Json string produced by my aspx webpage.. 我有我的aspx网页制作的扁平Json字符串..

[{"UserName":"ABENS"},{"UserName":"AILPAL"},{"UserName":"ANDREW.GUILLERMO"}.....(so on so forth)]

I have declared the following html.. 我已声明以下html ..

            <table id="tblUserAccountsManagement" class="display" cellspacing="0">                    
                         <thead>
                            <tr>
                                <th>UserName</th>

                            </tr>
                        </thead>                                

                    </table>

I have the following Jquery... 我有以下Jquery ......

  $(document).ready(function () {

        var tbl = $('#tblUserAccountsManagement').DataTable({

            "ajax": {

                "url": "AccountsManagementJSON.aspx",
                "dataSrc": ""

            },

            "columns": [

                { "data": 'UserName' }

            ],
            autofill: true,
            select: true,
            responsive: true,
            buttons: true,
            length: 10,

        });
    });

Why does it still output the error? 为什么它仍然输出错误?

Requested unknown parameter '0' for row '0' column '0' 行'0'列'0'请求未知参数'0'

I've read everything followed every troubleshoot there is, made sure that html and jQuery definition are intact.. why doesn't it still work? 我读过的一切跟着每一个解决存在,确信,HTML和jQuery的定义是完好的。为什么不它仍然工作?

What I don't understand is that I've tried this before here and it worked. 我不明白的是,我已经试过这之前,在这里,它的工作。 I only had to add dataSrc: "" and that did the trick. 我只需要添加dataSrc: ""就可以了。 I followed my previous example to the letter and now it does not work. 我按照前面的例子写了这封信,现在它不起作用。

What's weird is that it does show the number of rows (39 rows like in the JSON) But it won't show content. 奇怪的是,它确实显示了行数(39行像JSON中那样)但它不会显示内容。 Why is that? 这是为什么?

I have resolved the problem: I have used aoColumns and mData with this setup (Webforms with MasterPages). 我已经解决了这个问题:我使用了aoColumnsmData这个设置(带有MasterPages的mData )。

the following now works : 以下现在有效:

 $(document).ready(function () {

    var tbl = $('#tblUserAccountsManagement').DataTable({

        "ajax": {

            "url": "AccountsManagementJSON.aspx",
            "dataSrc": ""

        },

        aoColumns: [

            { mData: 'UserName' }

        ],
        autofill: true,
        select: true,
        responsive: true,
        buttons: true,
        length: 10,

    });
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 数据表-第0行第0列的请求的未知参数&#39;0&#39; - Datatables - Requested unknown parameter '0' for row 0, column 0 请求第0行的未知参数“ 5”(jquery数据表) - Requested unknown parameter '5' for row 0 (jquery datatables) jQuery DataTables请求的未知参数 - jQuery DataTables requested unknown parameter DataTables警告:table id = example - 第1行第1列请求的未知参数“1” - DataTables warning: table id=example - Requested unknown parameter '1' for row 1, column 1 数据表:第1行请求的未知参数“ case” - DataTables: Requested unknown parameter 'case' for row 1 jQuery数据表请求未知参数问题 - Jquery Datatables requested unknown parameter problem DataTables - 请求的未知参数 - DataTables - Requested unknown parameter 数据表显示:DataTables 警告:表 id=userdetails - 为第 0 行、第 1 列请求未知参数“1” - Datatable showing :DataTables warning: table id=userdetails - Requested unknown parameter '1' for row 0, column 1 数据表错误:第0行第10列请求的未知参数&#39;10&#39;; 尝试将复选框添加到数据表时 - Datatables error: Requested unknown parameter '10' for row 0, column 10; when tried to add checkbox to the datatable DataTables警告:表ID = table_especie-请求的未知参数&#39;0&#39;,用于第0行第0列 - DataTables warning: table id=table_especie - Requested unknown parameter '0' for row 0, column 0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM