jquery数据表隐藏列

编程入门 行业动态 更新时间:2024-10-27 02:22:35
本文介绍了jquery数据表隐藏列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jquery 数据表插件有没有办法隐藏(和显示)表列?

Is there a way with the jquery datatables plugin to hide (and show) a table column?

我想出了如何重新加载表格数据:使用 fnClearTablefnAddData.

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:关键词]

本文发布于:2023-03-28 05:07:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/720907.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据表   jquery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!