# PopupFilter | tablefilter v0.4.16 API Document

    import {PopupFilter} from 'tablefilter/src/modules/popupFilter.js'

public class | source

# PopupFilter

#### Extends:

Feature → PopupFilter

Pop-up filter component

## Constructor Summary

Public Constructor
public | constructor (tf: TableFilter) Creates an instance of PopupFilter |

## Member Summary

Public Members
public | activeIconPath : string Active filter icon path |
public | adjustToContainer : Boolean Ensure filter's container element width matches column width, enabled by default |
public | closeOnFiltering : Boolean Close active popup filter upon filtering, enabled by default |
public | containerCssClass : String Css class assigned to filter container element |
public | iconHtml : string HTML for the filter icon |
public | iconPath : String Filter icon path |
public | initialized : boolean |
public | onAfterClose : Function Callback fired after a popup filter is closed |
public | onAfterOpen : Function Callback fired after a popup filter is opened |
public | onBeforeClose : Function Callback fired before a popup filter is closed |
public | onBeforeOpen : Function Callback fired before a popup filter is opened |

## Method Summary

Public Methods
public | build (colIndex: Number, div: Object) Build a specified pop-up filter elements |
public | buildAll () Build all pop-up filters elements |
public | buildIcons () Build all filters icons |
public | changeState (colIndex: Number, active: Boolean) Apply specified icon state |
public | close (colIndex: Number) Close popup filter of specified column |
public | closeAll (exceptIdx: Number) Close all filters excepted for the specified one if any |
public | destroy () Remove pop-up filters |
public | init () Initialize DOM elements |
public | isOpen (colIndex: Number): Boolean Check if popup filter for specified column is open |
public | open (colIndex: Number) Open popup filter of specified column |
public | reset () Reset previously destroyed feature |
public | setIconsState () Build all the icons representing the pop-up filters |
public | toggle (colIndex: Number) Toggle visibility of specified filter |

## 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) source

Creates an instance of PopupFilter

#### Override:

Feature#constructor

#### Params:

Name | Type | Attribute | Description
tf | TableFilter |  | TableFilter instance

## Public Members

### public activeIconPath: string source

Active filter icon path

### public adjustToContainer: Boolean source

Ensure filter's container element width matches column width, enabled by default

### public closeOnFiltering: Boolean source

Close active popup filter upon filtering, enabled by default

### public containerCssClass: String source

Css class assigned to filter container element

### public iconHtml: string source

HTML for the filter icon

### public iconPath: String source

Filter icon path

### public initialized: boolean source

#### Override:

Feature#initialized

### public onAfterClose: Function source

Callback fired after a popup filter is closed

### public onAfterOpen: Function source

Callback fired after a popup filter is opened

### public onBeforeClose: Function source

Callback fired before a popup filter is closed

### public onBeforeOpen: Function source

Callback fired before a popup filter is opened

## Public Methods

### public build(colIndex: Number, div: Object) source

Build a specified pop-up filter elements

#### Params:

Name | Type | Attribute | Description
colIndex | Number |  | Column index
div | Object |  | Optional container DOM element

### public buildAll() source

Build all pop-up filters elements

### public buildIcons() source

Build all filters icons

### public changeState(colIndex: Number, active: Boolean) source

Apply specified icon state

#### Params:

Name | Type | Attribute | Description
colIndex | Number |  | Column index
active | Boolean |  | Apply active state

### public close(colIndex: Number) source

Close popup filter of specified column

#### Params:

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

### public closeAll(exceptIdx: Number) source

Close all filters excepted for the specified one if any

#### Params:

Name | Type | Attribute | Description
exceptIdx | Number |  | Column index of the filter to not close

### public destroy() source

Remove pop-up filters

#### Override:

Feature#destroy

### public init() source

Initialize DOM elements

#### Override:

Feature#init

### public isOpen(colIndex: Number): Boolean source

Check if popup filter for specified column is open

#### Params:

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

#### Return:

Boolean

### public open(colIndex: Number) source

Open popup filter of specified column

#### Params:

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

### public reset() source

Reset previously destroyed feature

#### Override:

Feature#reset

### public setIconsState() source

Build all the icons representing the pop-up filters

### public toggle(colIndex: Number) source

Toggle visibility of specified filter

#### Params:

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