Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery Datatables列计数错误-请求的未知参数';0';对于第0行,第0列_Datatables - Fatal编程技术网

jQuery Datatables列计数错误-请求的未知参数';0';对于第0行,第0列

jQuery Datatables列计数错误-请求的未知参数';0';对于第0行,第0列,datatables,Datatables,我知道这是一个很常见的问题。但我花了几乎一天的时间,因为我无法发现错误,我不得不发布这篇文章。有人能看出错误吗 标记:- <table class="table align-items-center table-flush py-3" id="inquiry-select-table"> <thead class="thead-light"> <tr> <th scope="col" style="disp

我知道这是一个很常见的问题。但我花了几乎一天的时间,因为我无法发现错误,我不得不发布这篇文章。有人能看出错误吗

标记:-

<table class="table align-items-center table-flush py-3" id="inquiry-select-table">
    <thead class="thead-light">
        <tr>
            <th scope="col" style="display:none">ID</th>
            <th scope="col" style="display:none">Version</th>
            <th scope="col" style="display:none">Created Date</th>
            <th scope="col" style="display:none">Created Time</th>
            <th scope="col" style="display:none">Updated Date</th>
            <th scope="col" style="display:none">Updated Time</th>
            <th scope="col" style="display:none">Client ID</th>
            <th scope="col">Client Name</th>
            <th scope="col">Knowledge Source</th>
            <th scope="col">Description</th>
        </tr>
    </thead>
    <tbody>

    </tbody>
</table>
从服务器接收的数据:-

我得到的错误是:-


根据,由于我得到一个整数作为参数,这意味着列计数与行计数不匹配。但对我来说似乎没问题。有人看到我漏掉的东西了吗?

好像你把
columnDefs
columns
对调了一下:

columnDefs: inquirySelectTableColumns,
columns: inquiryColumnDefs,
交换它们就可以了:

columnDefs: inquiryColumnDefs,
columns: inquirySelectTableColumns,
示例叉:

只是在这里拍摄一下,但可能是这样:
var inquiryColumnDefs=[{“targets”:[0,1,2,3,4,5,6]——这一行在这里解释说,第0行第0列的未知参数0“可见”:false,“可搜索”:false}
似乎targets:需要您的
inquirySelectTableColumns
数组值。@RyanWilson实际上我对其他数据表也使用了相同的列定义(“visible”:false,“searchable”:false,用于6列),它们工作正常。我只是在你提到后评论了这3行,但问题仍然存在。很抱歉,我现在没有更多的东西可以提供。和我一样:)谢谢你的尝试,这可能是因为目标中列出的列比表标题中列出的列少,请参阅此处有关此错误的文档()链接文档中的特定节文本
表格中的单元格数量不满足方程式#cells=#columns*#rows(即标题中定义的列多于表体中定义的列,反之亦然)。
谢谢。成功了!我简直不敢相信我闭着眼睛花了将近一天的时间。没问题。是的,确实如此。一双新的眼睛起了作用。快乐编码!
columnDefs: inquiryColumnDefs,
columns: inquirySelectTableColumns,