Home Reference Source
import {Dropdown} from 'tablefilter/src/modules/dropdown.js'
public class | source

Dropdown

Extends:

FeatureBaseDropdown → Dropdown

Dropdown filter UI component

Constructor Summary

Public Constructor
public

Creates an instance of Dropdown

Member Summary

Public Members
public

Enable the reset filter option as first item

public
public
public

Tooltip text appearing on multiple select

public

Non empty option text

public

opts: *[]

public

optsTxt: *[]

Method Summary

Public Methods
public

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

Refresh all drop-down filters

public

selectOptions(colIndex: Number, values: Array)

Select filter options programmatically

Inherited Summary

From class Feature
public

TableFilter configuration

public

TableFilter emitter instance

public

TableFilter feature setting

public

Feature name is the camelised class name as per TableFilter's convention

public

Field indicating whether Feature is initialized

public

TableFilter instance

public

Destroy the feature

public

Disable the feature

public

enable()

Enable the feature

public

init()

Initialize the feature

public

Indicate whether the feature is enabled or not

public

reset()

Reset the feature after being disabled

From class BaseDropdown
public

Filter options custom sorter on a column basis

public

isValidLinkedValue(rowIdx: Number, activeFilterIdx: Number): Boolean

Check passed row contains a valid linked value

public

Refresh linked filters to offer only selected options

Public Constructors

public constructor(tf: TableFilter) source

Creates an instance of Dropdown

Override:

BaseDropdown#constructor

Params:

NameTypeAttributeDescription
tf TableFilter

TableFilter instance

Public Members

public enableSlcResetFilter: Boolean source

Enable the reset filter option as first item

public initialized: boolean source

Field indicating whether Feature is initialized

Override:

Feature#initialized

public isCustom: * source

public multipleSlcTooltip: String source

Tooltip text appearing on multiple select

public nonEmptyText: String source

Non empty option text

public opts: *[] source

public optsTxt: *[] source

Public Methods

public addFirstOption(slc: Object): * source

Add drop-down header option

Params:

NameTypeAttributeDescription
slc Object

Select DOM element

Return:

*

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

Add drop-down options

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
colIndex Number

Column index

isExternal Boolean

External filter flag

container DOMElement

Dom element containing the filter

public refreshAll() source

Refresh all drop-down filters

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

Select filter options programmatically

Params:

NameTypeAttributeDescription
colIndex Number

Column index

values Array

Array of option values to select