问题
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);
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.
Please advise. Thanks
回答1:
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)
{
...
}
};
来源:https://stackoverflow.com/questions/9334690/how-to-determine-if-a-column-is-visible-or-not-on-a-jquery-datatable