# Dropdown | tablefilter v0.4.16 API Document

    import {Dropdown} from 'tablefilter/src/modules/dropdown.js'

public class | source

# Dropdown

#### Extends:

Feature → Dropdown

Dropdown filter UI component

## Constructor Summary

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

## Member Summary

Public Members
public | enableSlcResetFilter : Boolean Enable the reset filter option as first item |
public | initialized : boolean |
public | multipleSlcTooltip : String Tooltip text appearing on multiple select |
public | nonEmptyText : String Non empty option text |

## Method Summary

Public Methods
public | addFirstOption (slc: Object): * Add drop-down header option |
public | addOptions (colIndex: Number, slc: Object, isLinked: Boolean, excludedOpts: Array) Add drop-down options |
public | build (colIndex: Number, isLinked: Boolean) Build drop-down filter UI |
public | destroy () Destroy Dropdown instance |
public | getValues (colIndex: Number): Array Get filter values for a given column index |
public | init (colIndex: Number, isExternal: Boolean, container: DOMElement) Initialize drop-down filter |
public | selectOptions (colIndex: Number, values: Array) Select filter options programmatically |

## 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 Dropdown

#### Override:

Feature#constructor

#### Params:

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

## Public Members

### public enableSlcResetFilter: Boolean source

Enable the reset filter option as first item

### public initialized: boolean source

#### Override:

Feature#initialized

### public multipleSlcTooltip: String source

Tooltip text appearing on multiple select

### public nonEmptyText: String source

Non empty option text

## Public Methods

### public addFirstOption(slc: Object): * source

Add drop-down header option

#### Params:

Name | Type | Attribute | Description
slc | Object |  | Select DOM element

#### Return:

*

### public addOptions(colIndex: Number, slc: Object, isLinked: Boolean, excludedOpts: Array) source

Add drop-down options

#### Params:

Name | Type | Attribute | Description
colIndex | Number |  | Column index
slc | Object |  | Select Dom element
isLinked | Boolean |  | Enable linked refresh behaviour
excludedOpts | Array |  | Array of excluded options

### public build(colIndex: Number, isLinked: Boolean) source

Build drop-down filter UI

#### Params:

Name | Type | Attribute | Description
colIndex | Number |  | Column index
isLinked | Boolean |  | Enable linked filters behaviour

### public destroy() source

Destroy Dropdown instance

#### Override:

Feature#destroy

### public getValues(colIndex: Number): Array source

Get filter values for a given column index

#### Params:

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

#### Return:

Array | values Array of selected values

### public init(colIndex: Number, isExternal: Boolean, container: DOMElement) source

Initialize drop-down filter

#### Override:

Feature#init

#### Params:

Name | Type | Attribute | Description
colIndex | Number |  | Column index
isExternal | Boolean |  | External filter flag
container | DOMElement |  | Dom element containing the filter

### public selectOptions(colIndex: Number, values: Array) source

Select filter options programmatically

#### Params:

Name | Type | Attribute | Description
colIndex | Number |  | Column index
values | Array |  | Array of option values to select