本文介绍了jquery数据表隐藏列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
jquery 数据表插件有没有办法隐藏(和显示)表列?
Is there a way with the jquery datatables plugin to hide (and show) a table column?
我想出了如何重新加载表格数据:使用 fnClearTable
和 fnAddData
.
I figured out how to reload the table data: using fnClearTable
and fnAddData
.
但我的问题是,在我的表格视图之一(例如隐藏模式)中,我不想显示某些列.
But my issue is that in one of my views for the table (e.g. a hidden mode) I don't want to show certain columns.
推荐答案
你可以通过这个命令隐藏列:
You can hide columns by this command:
fnSetColumnVis( 1, false );
其中第一个参数是列的索引,第二个参数是可见性.
Where first parameter is index of column and second parameter is visibility.
通过:http://www.datatables/api - 函数 fnSetColumnVis
这篇关于jquery数据表隐藏列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论