javascript - Colvis 不显示任何列
问题描述
schedule_Open_Datatable = $("#make_schedule_open_table").DataTable({
columnDefs: [
{ className: "control", orderable: false, targets: 1, width: "5%" },
{ orderable: false, targets: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11] }
],
responsive: {
details: {
type: "column",
target: 1,
},
},
//scrollX: true,
buttons: ["copy", "csv", "excel", "pdf", "print", "colvis"],
sPaginationType: "full_numbers",
ajax: {
url: SODUrl,
// our data is an array of objects, in the root node instead of /data node, so we need 'dataSrc' parameter
dataSrc: "",
},
columns: columns,
rowReorder: { dataSrc: "seq" },
order: [[0, 'asc']],
dom: "<'row'<'col-sm-6'B><'col-sm-6'f>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-4'l><'col-sm-4'i><'col-sm-4'p>>",
select: "single",
//ordering: false,
createdRow: function (row, data, dataIndex) {
$(row).attr("data-id", data.id);
},
colvis 按钮存在于页面上,但它不想显示任何列,我有所有需要的链接,我尝试使用 bootstrap 4 页面上使用的示例,但仍然无法正常工作。
解决方案
推荐阅读
- python - 如何将表格的数据从 Html 传输到 view.py (Python)
- spring - 如何从 Spring WebClient 获取响应 json
- javascript - 无法上传 pdf 文件:Php
- python - 针对字典文件(JSON)测试用户输入
- angular - .Net Core 3.1 和 Angular 在 Visual Studio 中编译冗长
- list - 方案中是否有“列出所有文件”程序?
- sql - 如果它匹配值则返回行,除非它的唯一标识符匹配错误的值
- laravel-5 - 我怎样才能找到整个列的总和?我想创建一个总计,它将计算整个总数并返回一个总结果
- python - 为什么在这段代码中变量 a 发生了变化?
- reactjs - 调用具有多个 DOM 元素引用的函数