gpt4 book ai didi

javascript - 具有 rowGrouping 的数据表无法隐藏列

转载 作者:搜寻专家 更新时间:2023-10-31 08:20:30 24 4
gpt4 key购买 nike

JS:

$(document).ready(function() {
// $( "#dashboard_container" ).tabs();
$('#listings').dataTable({
"bRetrieve": true,
"aoColumns":
[
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
]
}).rowGrouping({
iGroupingColumnIndex: 1,
sGroupingColumnSortDirection: "asc",
iGroupingOrderByColumnIndex: 0,
bExpandableGrouping: true,
bExpandSingleGroup: true,
iExpandGroupOffset: -1
});
});

HTML:

    <table class="datatable" id="listings">
<thead>
<tr>
<th>Group Index</th><th>Group Display Name</th>
<th>Organization</th>
<th>Volumes</th>
<th>Read (MB/s)</th>
<th>Write (MB/s)</th>
<th>Volume Size (GB)</th>
<th>My Cost (USD)</th>
<th>Comments</th>
</tr>
</thead>
<tfoot></tfoot>
<tbody>
<tr>
<td>0</td><td><a href="/dashboard/" class="orglist_group_link">Artful Scientific</a></td>
<td>Something Co.</td>
<td><a href="/details/view?volume=12345678" class="orglist_link">information</a></td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>$0</td>
<td><a class="btn small icon i_preview comment_edit_button" rel="1" title="edit or view comment">View</a></td>
</tr>
</tbody>
</table>
</div>

问题:

我能够成功地进行行分组并且工作正常,但是我需要将其中的 2 列隐藏到某些 Angular 色。以及隐藏一个附加列,该列相当于分组使用的“组织”列。但是从上面的 JS 你可以看到我已经尝试隐藏所有列只是为了看看在我来到这里之前的最后努力中是否真的会隐藏任何列。无论是全部还是一个都不会隐藏。有人知道解决这个问题吗?因为我需要保留列但隐藏到实际 View 中

最佳答案

使用此命令隐藏列,第一个参数是列的索引和第二个参数是可见性

fnSetColumnVis( 1, false );

关于javascript - 具有 rowGrouping 的数据表无法隐藏列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12394653/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com