如何确定列在Jquery数据表上是否可见 [英] How to determine if a column is visible or not on a Jquery datatable

查看:105
本文介绍了如何确定列在Jquery数据表上是否可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jQuery的数据表,偶尔使用下面的代码切换某些列的可见性

I am using jQuery's datatable and I occasionally toggle the visiblity of some of the columns using the below code

tableId.fnSetColumnVis(0, false);

完成此操作后,UI上还有其他一些控件需要切换可见性.因此,我需要检查(对页面加载说一下)索引为0的列是否可见/隐藏/存在-等等.

Having done that, there are some other controls on the UI that I was to toggle the visibility for. So, I need to check (Say on page load) if the column with 0 index is visible/hidden/present - whatever.

请告知.谢谢

推荐答案

如果您想知道某个列是否可见,可以执行以下操作:

If you want to know if a column is visible or not you can do this :

 //options are the datatable options
 options.fnDrawCallback = function(oSettings) {
    if (oSettings.aoColumns[0].bVisible)
    {
    ...
    }
 };

这篇关于如何确定列在Jquery数据表上是否可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆