# ColsVisibility | tablefilter v0.5.3 API Document

    import ColsVisibility from 'tablefilter/src/extensions/colsVisibility/colsVisibility.js'

public class | source

# ColsVisibility

#### Extends:

Feature → ColsVisibility

Columns Visibility extension

## Constructor Summary

Public Constructor
public | constructor (tf: TableFilter, Configuration: Object) Creates an instance of ColsVisibility |

## Member Summary

Public Members
public | atStart : Array List of columns indexes to be hidden at initialization |
public | btnCloseCssClass : String Css for columns manager UI close link |
public | btnCloseHtml : String Columns manager UI close link HTML |
public | btnCloseText : String Columns manager UI close link text, defaults to 'Close' |
public | btnCssClass : String Css class for button |
public | btnHtml : String Button's inner HTML |
public | btnText : String Button's text, defaults to Columns▼ |
public | btnTgtId : String ID of button's container element |
public | contCssClass : String Css for columns manager UI main container |
public | contElTgtId : String ID of main container element |
public | desc : String Module description |
public | enableHover : Boolean Enable hover behaviour on columns manager button/link |
public | enableTickAll : Boolean Enable select all option, disabled by default |
public | headersIndex : Number Headers row index only if headers are external |
public | headersTbl : DOMElement Headers HTML table reference only if headers are external |
public | headersText : Array Alternative text for column headers in column manager UI |
public | initialized : boolean |
public | listCssClass : String Css for columns manager UI checklist (ul) |
public | listItemCssClass : String Css for columns manager UI checklist item (li) |
public | listSlcItemCssClass : String Css for columns manager UI checklist item selected state (li) |
public | manager : Boolean Enable columns manager UI, defaults to true |
public | name : String Module name |
public | onAfterClose : Function Callback fired after the columns manager is closed |
public | onAfterColDisplayed : Function Callback fired after a column is displayed |
public | onAfterColHidden : Function Callback fired after a column is hidden |
public | onAfterOpen : Function Callback fired after the columns manager is opened |
public | onBeforeClose : Function Callback fired before the columns manager is closed |
public | onBeforeColDisplayed : Function Callback fired before a column is displayed |
public | onBeforeColHidden : Function Callback fired before a column is hidden |
public | onBeforeOpen : Function Callback fired before the columns manager is opened |
public | onLoaded : Function Callback fired when the extension is initialized |
public | spanCssClass : String Css for columns manager UI span |
public | stylesheet : String Extension's stylesheet filename |
public | text : String Text preceding the columns list, defaults to 'Hide' or 'Show' depending on tick mode (tick_to_hide option) |
public | tickAllText : String Text for select all option, defaults to 'Select all:' |
public | tickToHide : Boolean Enable tick to hide a column, defaults to true |

## Method Summary

Public Methods
public | buildBtn () Build main button UI |
public | buildManager () Build columns manager UI |
public | destroy () Remove the columns manager |
public | getHiddenCols (): Array Return the indexes of the columns currently hidden |
public | hideCol (colIndex: Number) Hide specified column |
public | init () Initializes ColsVisibility instance |
public | isColHidden (colIndex: Number): boolean Determine if specified column is hidden |
public | setHidden (colIndex: Number, hide: Boolean) Hide or show specified columns |
public | showCol (colIndex: Number) Show specified column |
public | toggle () Toggle columns manager UI |
public | toggleCol (colIndex: Number) Toggle visibility of specified column |

## Inherited Summary

From class Feature
public | config : Object TableFilter configuration |
public | emitter : Emitter TableFilter emitter instance |
public | enabled : Boolean TableFilter feature setting |
public | feature : String Feature name |
public | initialized : Boolean Field indicating whether Feature is initialized |
public | tf : TableFilter TableFilter instance |
public | destroy () Destroy the feature |
public | disable () Disable the feature |
public | enable () Enable the feature |
public | init () Initialize the feature |
public | isEnabled (): Boolean Indicate whether the feature is enabled or not |
public | reset () Reset the feature after being disabled |

## Public Constructors

### public constructor(tf: TableFilter, Configuration: Object) source

Creates an instance of ColsVisibility

#### Override:

Feature#constructor

#### Params:

Name | Type | Attribute | Description
tf | TableFilter |  | TableFilter instance
Configuration | Object |  | object

## Public Members

### public atStart: Array source

List of columns indexes to be hidden at initialization

### public btnCloseCssClass: String source

Css for columns manager UI close link

### public btnCloseHtml: String source

Columns manager UI close link HTML

### public btnCloseText: String source

Columns manager UI close link text, defaults to 'Close'

### public btnCssClass: String source

Css class for button

### public btnHtml: String source

Button's inner HTML

### public btnText: String source

Button's text, defaults to Columns▼

### public btnTgtId: String source

ID of button's container element

### public contCssClass: String source

Css for columns manager UI main container

### public contElTgtId: String source

ID of main container element

### public desc: String source

Module description

### public enableHover: Boolean source

Enable hover behaviour on columns manager button/link

### public enableTickAll: Boolean source

Enable select all option, disabled by default

### public headersIndex: Number source

Headers row index only if headers are external

### public headersTbl: DOMElement source

Headers HTML table reference only if headers are external

### public headersText: Array source

Alternative text for column headers in column manager UI

### public initialized: boolean source

#### Override:

Feature#initialized

### public listCssClass: String source

Css for columns manager UI checklist (ul)

### public listItemCssClass: String source

Css for columns manager UI checklist item (li)

### public listSlcItemCssClass: String source

Css for columns manager UI checklist item selected state (li)

### public manager: Boolean source

Enable columns manager UI, defaults to true

### public name: String source

Module name

### public onAfterClose: Function source

Callback fired after the columns manager is closed

### public onAfterColDisplayed: Function source

Callback fired after a column is displayed

### public onAfterColHidden: Function source

Callback fired after a column is hidden

### public onAfterOpen: Function source

Callback fired after the columns manager is opened

### public onBeforeClose: Function source

Callback fired before the columns manager is closed

### public onBeforeColDisplayed: Function source

Callback fired before a column is displayed

### public onBeforeColHidden: Function source

Callback fired before a column is hidden

### public onBeforeOpen: Function source

Callback fired before the columns manager is opened

### public onLoaded: Function source

Callback fired when the extension is initialized

### public spanCssClass: String source

Css for columns manager UI span

### public stylesheet: String source

Extension's stylesheet filename

### public text: String source

Text preceding the columns list, defaults to 'Hide' or 'Show' depending on tick mode (tick_to_hide option)

### public tickAllText: String source

Text for select all option, defaults to 'Select all:'

### public tickToHide: Boolean source

Enable tick to hide a column, defaults to true

## Public Methods

### public buildBtn() source

Build main button UI

### public buildManager() source

Build columns manager UI

### public destroy() source

Remove the columns manager

#### Override:

Feature#destroy

### public getHiddenCols(): Array source

Return the indexes of the columns currently hidden

#### Return:

Array | column indexes

### public hideCol(colIndex: Number) source

Hide specified column

#### Params:

Name | Type | Attribute | Description
colIndex | Number |  | Column index

### public init() source

Initializes ColsVisibility instance

#### Override:

Feature#init

### public isColHidden(colIndex: Number): boolean source

Determine if specified column is hidden

#### Params:

Name | Type | Attribute | Description
colIndex | Number |  | Column index

#### Return:

boolean

### public setHidden(colIndex: Number, hide: Boolean) source

Hide or show specified columns

#### Params:

Name | Type | Attribute | Description
colIndex | Number |  | Column index
hide | Boolean |  | Hide column if true or show if false

### public showCol(colIndex: Number) source

Show specified column

#### Params:

Name | Type | Attribute | Description
colIndex | Number |  | Column index

### public toggle() source

Toggle columns manager UI

### public toggleCol(colIndex: Number) source

Toggle visibility of specified column

#### Params:

Name | Type | Attribute | Description
colIndex | Number |  | Column index