javascript - JQuery DataTables 和 ColVis 插件错误 "Cannot read property ' sWidth' of undefined"

标签 javascript jquery datatables

将 jquery.datatables 插件与 ColVis 插件一起使用,我在删除列时收到此错误:

“无法读取未定义的属性‘sWidth’”。我一直无法在线找到解决此错误的方法。

我不确定是什么导致了这个错误,尽管我确实有一个修复程序,我想发布以帮助遇到此问题的其他人。

我正在使用来自 http://datatables.net/ 的 jquery.datatables 1.9.4 .

最佳答案

当列数在

<thead></thead>

不同于

中的列数
$('#ls-table').DataTable($.extend({}, window.coonDataTableOptions, {
    columns: [
         <here>
    ]
 }));

关于javascript - JQuery DataTables 和 ColVis 插件错误 "Cannot read property ' sWidth' of undefined",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20673825/

相关文章:

javascript - 试验 DOM 函数

javascript - 实时预览 Iframe

javascript - JsDoc:从属性中删除 "static"标记

javascript - jQuery 加载 &lt;script&gt; 但在 AngularJS 下不评估相同内容

jquery - 如何在Ajax加载数据表中使用回调函数?

javascript - 在数据表中单击选择行并将所选数据导出为 Excel

Jquery animate left 不起作用,出了什么问题?

php - 如何在 React 应用程序中包含 PHP 脚本

datatables - 如何使用jQuery DataTables在单元格中显示超链接

php - jquery 数据表搜索不起作用,但其他一切都很好