# TableFilter | tablefilter v0.5.3 API Document

    import {TableFilter} from 'tablefilter/src/tablefilter.js'

public class | source

# TableFilter

Makes HTML tables filterable and a bit more :)

## Constructor Summary

Public Constructor
public | constructor (table: DOMElement, id: String, row: Number, configuration: Object) Creates an instance of TableFilter requires `table` or `id` arguments, `row` and `configuration` optional |

## Member Summary

Public Members
public | activeColumnsCssClass : String Css class for filtered (active) columns |
public | alternateRows : Boolean Enable/disable alternating rows |
public | anOperator : String Logical AND operator for input filter. |
public | autoFilter : Boolean Enable auto-filter behaviour, table is filtered when a user stops typing |
public | autoFilterDelay : Number Auto-filter delay in msecs |
public | basePath : String Base path for static assets |
public | btnCssClass : String Css class for filters submission button |
public | btnReset : Boolean Enable clear button |
public | btnText : String Define filters submission button text |
public | caseSensitive : Boolean Enable/disable case sensitivity filtering |
public | cellParser : Object Specify which column implements a custom cell parser to retrieve the cell value: cell_parser: { cols: [0, 2], parse: function(tf, cell, colIndex) { // custom cell parser logic here return cellValue; } } |
public | clearFilterText : String | Array Text for clear option in drop-down filter types (1st option) |
public | colTypes : Array Define data types on a column basis, possible values 'string', 'number', 'formatted-number', 'date', 'ipaddress' ie: col_types : [ 'string', 'date', 'number', { type: 'formatted-number', decimal: ',', thousands: '.' }, { type: 'date', locale: 'en-gb' }, { type: 'date', format: ['{dd}-{months}-{yyyy|yy}'] } ] |
public | colWidths : Array Columns widths array |
public | customOptions : Object Custom options definition of a per column basis, ie: custom_options: { cols:[0, 1], texts: [ ['a0', 'b0', 'c0'], ['a1', 'b1', 'c1'] ], values: [ ['a0', 'b0', 'c0'], ['a1', 'b1', 'c1'] ], sorts: [false, true] } |
public | decimalSeparator : String Define decimal separator ',' or '.', defaults to '.' |
public | dfOperator : String Inequality operator for input filter. |
public | disableExcludedOptions : Boolean Enable/disable readonly state for excluded options when linked filters filtering mode is on |
public | displayBtn : Boolean Enable filters submission button |
public | emOperator : String Empty cells operator for input filter. |
public | emitter : Emitter Event emitter instance |
public | emptyText : String Text for empty option in drop-down filter types |
public | enOperator : String Ends with operator for input filter. |
public | enableDefaultTheme : Boolean Enable default theme |
public | enableEmptyOption : Boolean Indicate whether empty option is enabled in drop-down filter types |
public | enableIcons : Boolean Enable/disable icons (paging, reset button) |
public | enableNonEmptyOption : Boolean Indicate whether non-empty option is enabled in drop-down filter types |
public | enterKey : Boolean Enable/disable enter key for input type filters |
public | eqOperator : String Strict equality operator for input filter. |
public | exactMatch : Boolean Globally enable/disable exact match filtering |
public | exactMatchByCol : Array Exact match filtering per column array |
public | externalFltTgtIds : Array List of containers IDs where external filters will be generated |
public | filtersRowIndex : Number Filters row index |
public | fltCellTag : String Define the type of cell containing a filter (td/th) |
public | fltCssClass : String Css class for a filter element |
public | fltGrid : Boolean Enable/disable filters |
public | fltMultiCssClass : String Css class for multiple select filters |
public | fltSmallCssClass : String Css class for small filter (when submit button is active) |
public | fltsRowCssClass : String Css class for the filters row |
public | geOperator : String Greater than or equal operator for input filter. |
public | grOperator : String Greater than operator for input filter. |
public | gridLayout : Boolean Enable/disable grid layout (fixed headers) |
public | hasCustomOptions : Boolean Indicate whether custom drop-down filter options are implemented |
public | hasVisibleRows : Boolean Enable/disable always visible rows, excluded from filtering |
public | help : Boolean Indicate whether help UI component is disabled |
public | highlightKeywords : Boolean Enable keyword highlighting behaviour |
public | ignoreDiacritics : Boolean | Array Ignore diacritics globally or on a column basis |
public | infDivCssClass : String Css class for toolbar's container DOM element |
public | initialized : boolean |
public | isExternalFlt : Boolean Enable/disable external filters generation |
public | lDivCssClass : String Css class for left-side inner container DOM element |
public | leOperator : String Lower than or equal operator for input filter. |
public | linkedFilters : Boolean Enable/disable linked filters filtering mode |
public | lkOperator : String Like operator for input filter. |
public | loadFltOnDemand : Boolean Indicate whether drop-down filter types are populated on demand at first usage |
public | loader : Boolean Enable activity/spinner indicator UI component |
public | locale : String Define default locale, default to 'en' as per Sugar Date module: https://sugarjs.com/docs/#/DateLocales |
public | lwOperator : String Lower than operator for input filter. |
public | mDivCssClass : String Css class for middle inner container DOM element |
public | markActiveColumns : Boolean Indicate whether filtered (active) columns indicator is enabled |
public | nmOperator : String Non-empty cells operator for input filter. |
public | noResults : Boolean Enable no results message UI component |
public | nonEmptyText : String Text for non-empty option in drop-down filter types |
public | onAfterActiveColumn : Function Callback fired after a column is marked as filtered |
public | onAfterFilter : Function Callback fired after filtering process is completed |
public | onAfterReset : Function Callback fired after filters are cleared |
public | onBeforeActiveColumn : Function Callback fired before a column is marked as filtered |
public | onBeforeFilter : Function Callback fired before filtering process starts |
public | onBeforeReset : Function Callback fired before filters are cleared |
public | onFiltersLoaded : Function Callback fired after filters are generated |
public | onRowValidated : Function Callback fired after a row is validated during filtering |
public | onSlcChange : Boolean Indicate whether drop-down filter types filter the table by default on change event |
public | orOperator : String Logical OR operator for input filter. |
public | paging : Boolean Enable paging component |
public | popupFilters : Boolean Indicate whether pop-up filters UI is enabled |
public | rDivCssClass : String Css class for right-side inner container DOM element |
public | refRow : Number Calculated row's index from which starts filtering once filters are generated |
public | responsive : Boolean Enable responsive layout |
public | rgxOperator : String Regular expression operator for input filter. |
public | rowsCounter : Boolean Enable rows counter UI component |
public | separator : String Stored values separator |
public | singleFltCssClass : String Css class for single filter type |
public | singleSearchFlt : Boolean Enable/disable single filter filtering all columns |
public | sortNumAsc : Array List of columns implementing options sorting in a ascending numeric manner |
public | sortNumDesc : Array List of columns implementing options sorting in a descending numeric manner |
public | sortSlc : Boolean Indicate whether options in drop-down filter types are sorted in a alpha-numeric manner by default |
public | stOperator : String Starts with operator for input filter. |
public | state : Boolean Enable state persistence |
public | statusBar : Boolean Enable status bar UI component |
public | stylePath : String Path for stylesheets |
public | stylesheet : String Main stylesheet path |
public | tbl : DOMElement HTML Table DOM element |
public | themes : Array List of themes, ie: themes: [{ name: 'skyblue' }] |
public | themesPath : Array Define path to themes assets, defaults to 'tablefilter/style/themes/'. |
public | thousandsSeparator : String Define thousands separator ',' or '.', defaults to ',' |
public | toolBarTgtId : String Toolbar's custom container ID |
public | version : String Current version |
public | visibleRows : Array List of row indexes to be excluded from filtering |
public | watermark : String | Array Global watermark text for input filter type or watermark for each filter if an array is supplied |

## Method Summary

Public Methods
public | activateFilter (colIndex: *) Make specified column's filter active |
public | clearActiveColumns () Clears filtered columns visual indicator (background color) |
public | clearFilters () Clear all the filters' values |
public | config (): Object Get the configuration object (literal object) |
public | destroy () Destroy filter grid |
public | destroyExtensions () Destroy all the extensions store in extensions registry |
public | detectKey (evt: Event) Detect <enter> key |
public | enforceVisibility () Makes defined rows always visible |
public | extension (name: String): Object Get an extension instance |
public | feature (name: String): Object Return a feature instance for a given name |
public | filter () Filter the table by retrieving the data from each cell in every single row and comparing it to the search term for current column. |
public | getActiveFilterId (): String Return the ID of the current active filter |
public | getCellData (cell: DOMElement): String | Number | Date Return the typed data of a given cell based on the column type definition |
public | getCellValue (Cell's: DOMElement): String Return the text content of a given cell |
public | getCellsNb (rowIndex: Number): Number Return the number of cells for a given row index |
public | getClearFilterText (colIndex: Number): String Returns clear all text for specified filter column |
public | getColValues (colIndex: Number, includeHeaders: Boolean, typed: Boolean, exclude: Array): Array Return the data of a specified column |
public | getColumnIndexFromFilterId (filterId: string): Number Return the column index for a given filter ID |
public | getCustomOptions (colIndex: Number): Array Returns an array [[value0, value1 ...],[text0, text1 ...]] with the custom options values and texts |
public | getFilterElement (index: Number): DOMElement Return the filter's DOM element for a given column |
public | getFilterId (index: Number): String Return the ID of a specified column's filter |
public | getFilterType (colIndex: Number): String Return the filter type for a specified column |
public | getFilterValue (index: Number): String Return the filter's value of a specified column |
public | getFilterableRowsNb (): Number Get the total number of filterable rows |
public | getFilteredData (includeHeaders: Boolean, excludeHiddenCols: Boolean, typed: Boolean): Array Return the filtered data with following format: [ [rowIndex, [value0, value1...]], [rowIndex, [value0, value1...]] ] |
public | getFilteredDataCol (colIndex: Number, includeHeaders: Boolean, typed: Boolean, exclude: Array, visible: Boolean): Array Return the filtered data for a given column index |
public | getFiltersByType (type: String, bool: Boolean): [type] Return the list of ids of filters matching a specified type. |
public | getFiltersId (): [type] Get list of filter IDs |
public | getFiltersRowIndex (): Number Get the index of the row containing the filters |
public | getFiltersValue (): Array Return the filters' values |
public | getHeaderElement (colIndex: Number): Element Get the header DOM element for a given column index |
public | getHeadersRowIndex (): Number Get the index of the headers row |
public | getHeadersText (excludeHiddenCols: Boolean): Array Return the list of headers' text |
public | getLastRowIndex (): Number Get the index of the last row |
public | getRowDisplay (row: HTMLTableRowElement): String Get the display value of a row |
public | getRowsNb (includeHeaders: Boolean): Number Return the number of filterable rows starting from reference row if defined |
public | getStartRowIndex (): Number Get the row index from where the filtering process start (1st filterable row) |
public | getStylesheet (name: string): DOMElement Return stylesheet DOM element for a given theme name |
public | getTableData (includeHeaders: Boolean, excludeHiddenCols: Boolean, typed: Boolean): Array Return the table data with following format: [ [rowIndex, [value0, value1...]], [rowIndex, [value0, value1...]] ] |
public | getValidRows (reCalc: Boolean): Array Get filtered (valid) rows indexes |
public | getValidRowsNb (reCalc: Boolean): Number Return the total number of valid rows |
public | hasExtension (name: String): Boolean Check passed extension name exists |
public | hasType (colIndex: Number, types: Array): Boolean Determine whether the specified column has one of the passed types |
public | ignoresDiacritics (colIndex: Number): Boolean Checks if specified column filter ignores diacritics. |
public | import (fileId: String, filePath: String, callback: Function, type: String) Import script or stylesheet |
public | init () Initialise features and layout |
public | initExtensions () Initialise all the extensions defined in the configuration object |
public | isCustomOptions (colIndex: Number): Boolean Check if given column implements a filter with custom options |
public | isExactMatch (colIndex: Number): Boolean Determines if passed filter column implements exact query match |
public | isImported (filePath: String, type: String): Boolean Check if passed script or stylesheet is already imported |
public | isInitialized (): Boolean Check if table has filters grid |
public | isRowDisplayed (rowIndex: Number): Boolean Checks if passed row is visible |
public | isRowValid (rowIndex: Number): Boolean Checks if passed row is valid |
public | linkFilters () Refresh the filters subject to linking ('select', 'multiple', 'checklist' type) |
public | loadExtension (ext: Object) Load an extension module |
public | loadThemes () Load themes defined in the configuration object |
public | markActiveColumn (colIndex: Number) Mark currently filtered column |
public | onInpBlur () Filter's blur event: if auto-filter on, clear interval on filter blur |
public | onInpFocus (evt: Event) Filter's focus event |
public | onKeyDown () Filter's keydown event: if auto-filter on, detect user is typing |
public | onKeyUp (evt: Event) Filter's keyup event: if auto-filter on, detect user is typing and filter columns |
public | removeExternalFlts () Remove all the external column filters |
public | removeToolbar () Remove toolbar container element |
public | setActiveFilterId (filterId: String) Set the ID of the current active filter |
public | setColWidths (tbl: Element) Set them columns' widths as per configuration |
public | setFilterValue (index: Number, query: String or Array) Set search value to a given filter |
public | setToolbar () Generate container element for paging, reset button, rows counter etc. |
public | validateAllRows () Validate all filterable rows |
public | validateRow (rowIndex: Number, isValid: Boolean) Validate/invalidate row by setting the 'validRow' attribute on the row |

## Public Constructors

### public constructor(table: DOMElement, id: String, row: Number, configuration: Object) source

Creates an instance of TableFilter requires `table` or `id` arguments, `row` and `configuration` optional

#### Params:

Name | Type | Attribute | Description
table | DOMElement |  | Table DOM element
id | String |  | Table id
row | Number |  | index indicating the 1st row
configuration | Object |  | object

## Public Members

### public activeColumnsCssClass: String source

Css class for filtered (active) columns

### public alternateRows: Boolean source

Enable/disable alternating rows

### public anOperator: String source

Logical AND operator for input filter. Defaults to '&&'

### public autoFilter: Boolean source

Enable auto-filter behaviour, table is filtered when a user stops typing

### public autoFilterDelay: Number source

Auto-filter delay in msecs

### public basePath: String source

Base path for static assets

### public btnCssClass: String source

Css class for filters submission button

### public btnReset: Boolean source

Enable clear button

### public btnText: String source

Define filters submission button text

### public caseSensitive: Boolean source

Enable/disable case sensitivity filtering

### public cellParser: Object source

Specify which column implements a custom cell parser to retrieve the cell value: cell_parser: { cols: [0, 2], parse: function(tf, cell, colIndex) { // custom cell parser logic here return cellValue; } }

### public clearFilterText: String | Array source

Text for clear option in drop-down filter types (1st option)

### public colTypes: Array source

Define data types on a column basis, possible values 'string', 'number', 'formatted-number', 'date', 'ipaddress' ie: col_types : [ 'string', 'date', 'number', { type: 'formatted-number', decimal: ',', thousands: '.' }, { type: 'date', locale: 'en-gb' }, { type: 'date', format: ['{dd}-{months}-{yyyy|yy}'] } ]

Refer to https://sugarjs.com/docs/#/DateParsing for exhaustive information on date parsing formats supported by Sugar Date

### public colWidths: Array source

Columns widths array

### public customOptions: Object source

Custom options definition of a per column basis, ie: custom_options: { cols:[0, 1], texts: [ ['a0', 'b0', 'c0'], ['a1', 'b1', 'c1'] ], values: [ ['a0', 'b0', 'c0'], ['a1', 'b1', 'c1'] ], sorts: [false, true] }

### public decimalSeparator: String source

Define decimal separator ',' or '.', defaults to '.'

### public dfOperator: String source

Inequality operator for input filter. Defaults to '!'

### public disableExcludedOptions: Boolean source

Enable/disable readonly state for excluded options when linked filters filtering mode is on

### public displayBtn: Boolean source

Enable filters submission button

### public emOperator: String source

Empty cells operator for input filter. Defaults to '[empty]'

### public emitter: Emitter source

Event emitter instance

### public emptyText: String source

Text for empty option in drop-down filter types

### public enOperator: String source

Ends with operator for input filter. Defaults to '='

### public enableDefaultTheme: Boolean source

Enable default theme

### public enableEmptyOption: Boolean source

Indicate whether empty option is enabled in drop-down filter types

### public enableIcons: Boolean source

Enable/disable icons (paging, reset button)

### public enableNonEmptyOption: Boolean source

Indicate whether non-empty option is enabled in drop-down filter types

### public enterKey: Boolean source

Enable/disable enter key for input type filters

### public eqOperator: String source

Strict equality operator for input filter. Defaults to '='

### public exactMatch: Boolean source

Globally enable/disable exact match filtering

### public exactMatchByCol: Array source

Exact match filtering per column array

### public externalFltTgtIds: Array source

List of containers IDs where external filters will be generated

### public filtersRowIndex: Number source

Filters row index

### public fltCellTag: String source

Define the type of cell containing a filter (td/th)

### public fltCssClass: String source

Css class for a filter element

### public fltGrid: Boolean source

Enable/disable filters

### public fltMultiCssClass: String source

Css class for multiple select filters

### public fltSmallCssClass: String source

Css class for small filter (when submit button is active)

### public fltsRowCssClass: String source

Css class for the filters row

### public geOperator: String source

Greater than or equal operator for input filter. Defaults to '>='

### public grOperator: String source

Greater than operator for input filter. Defaults to '>'

### public gridLayout: Boolean source

Enable/disable grid layout (fixed headers)

### public hasCustomOptions: Boolean source

Indicate whether custom drop-down filter options are implemented

### public hasVisibleRows: Boolean source

Enable/disable always visible rows, excluded from filtering

### public help: Boolean source

Indicate whether help UI component is disabled

### public highlightKeywords: Boolean source

Enable keyword highlighting behaviour

### public ignoreDiacritics: Boolean | Array source

Ignore diacritics globally or on a column basis

### public infDivCssClass: String source

Css class for toolbar's container DOM element

### public initialized: boolean source

### public isExternalFlt: Boolean source

Enable/disable external filters generation

### public lDivCssClass: String source

Css class for left-side inner container DOM element

### public leOperator: String source

Lower than or equal operator for input filter. Defaults to '<='

### public linkedFilters: Boolean source

Enable/disable linked filters filtering mode

### public lkOperator: String source

Like operator for input filter. Defaults to '!'

### public loadFltOnDemand: Boolean source

Indicate whether drop-down filter types are populated on demand at first usage

### public loader: Boolean source

Enable activity/spinner indicator UI component

### public locale: String source

Define default locale, default to 'en' as per Sugar Date module: https://sugarjs.com/docs/#/DateLocales

### public lwOperator: String source

Lower than operator for input filter. Defaults to '<'

### public mDivCssClass: String source

Css class for middle inner container DOM element

### public markActiveColumns: Boolean source

Indicate whether filtered (active) columns indicator is enabled

### public nmOperator: String source

Non-empty cells operator for input filter. Defaults to '[nonempty]'

### public noResults: Boolean source

Enable no results message UI component

### public nonEmptyText: String source

Text for non-empty option in drop-down filter types

### public onAfterActiveColumn: Function source

Callback fired after a column is marked as filtered

### public onAfterFilter: Function source

Callback fired after filtering process is completed

### public onAfterReset: Function source

Callback fired after filters are cleared

### public onBeforeActiveColumn: Function source

Callback fired before a column is marked as filtered

### public onBeforeFilter: Function source

Callback fired before filtering process starts

### public onBeforeReset: Function source

Callback fired before filters are cleared

### public onFiltersLoaded: Function source

Callback fired after filters are generated

### public onRowValidated: Function source

Callback fired after a row is validated during filtering

### public onSlcChange: Boolean source

Indicate whether drop-down filter types filter the table by default on change event

### public orOperator: String source

Logical OR operator for input filter. Defaults to '||'

### public paging: Boolean source

Enable paging component

### public popupFilters: Boolean source

Indicate whether pop-up filters UI is enabled

### public rDivCssClass: String source

Css class for right-side inner container DOM element

### public refRow: Number source

Calculated row's index from which starts filtering once filters are generated

### public responsive: Boolean source

Enable responsive layout

### public rgxOperator: String source

Regular expression operator for input filter. Defaults to 'rgx:'

### public rowsCounter: Boolean source

Enable rows counter UI component

### public separator: String source

Stored values separator

### public singleFltCssClass: String source

Css class for single filter type

### public singleSearchFlt: Boolean source

Enable/disable single filter filtering all columns

### public sortNumAsc: Array source

List of columns implementing options sorting in a ascending numeric manner

### public sortNumDesc: Array source

List of columns implementing options sorting in a descending numeric manner

### public sortSlc: Boolean source

Indicate whether options in drop-down filter types are sorted in a alpha-numeric manner by default

### public stOperator: String source

Starts with operator for input filter. Defaults to '='

### public state: Boolean source

Enable state persistence

### public statusBar: Boolean source

Enable status bar UI component

### public stylePath: String source

Path for stylesheets

### public stylesheet: String source

Main stylesheet path

### public tbl: DOMElement source

HTML Table DOM element

### public themes: Array source

List of themes, ie: themes: [{ name: 'skyblue' }]

### public themesPath: Array source

Define path to themes assets, defaults to 'tablefilter/style/themes/'. Usage: themes: [{ name: 'skyblue' }]

### public thousandsSeparator: String source

Define thousands separator ',' or '.', defaults to ','

### public toolBarTgtId: String source

Toolbar's custom container ID

### public version: String source

Current version

### public visibleRows: Array source

List of row indexes to be excluded from filtering

### public watermark: String | Array source

Global watermark text for input filter type or watermark for each filter if an array is supplied

## Public Methods

### public activateFilter(colIndex: *) source

Make specified column's filter active

#### Params:

Name | Type | Attribute | Description
colIndex | * |  | Index of a column

### public clearActiveColumns() source

Clears filtered columns visual indicator (background color)

### public clearFilters() source

Clear all the filters' values

### public config(): Object source

Get the configuration object (literal object)

#### Return:

Object

### public destroy() source

Destroy filter grid

### public destroyExtensions() source

Destroy all the extensions store in extensions registry

### public detectKey(evt: Event) source

Detect <enter> key

#### Params:

Name | Type | Attribute | Description
evt | Event |  |

### public enforceVisibility() source

Makes defined rows always visible

### public extension(name: String): Object source

Get an extension instance

#### Params:

Name | Type | Attribute | Description
name | String |  | Name of the extension

#### Return:

Object | Extension instance

### public feature(name: String): Object source

Return a feature instance for a given name

#### Params:

Name | Type | Attribute | Description
name | String |  | Name of the feature

#### Return:

Object

### public filter() source

Filter the table by retrieving the data from each cell in every single row and comparing it to the search term for current column. A row is hidden when all the search terms are not found in inspected row.

### public getActiveFilterId(): String source

Return the ID of the current active filter

#### Return:

String

### public getCellData(cell: DOMElement): String | Number | Date source

Return the typed data of a given cell based on the column type definition

#### Params:

Name | Type | Attribute | Description
cell | DOMElement |  | Cell's DOM element

#### Return:

String | Number | Date

### public getCellValue(Cell's: DOMElement): String source

Return the text content of a given cell

#### Params:

Name | Type | Attribute | Description
Cell's | DOMElement |  | DOM element

#### Return:

String

### public getCellsNb(rowIndex: Number): Number source

Return the number of cells for a given row index

#### Params:

Name | Type | Attribute | Description
rowIndex | Number |  | Index of the row

#### Return:

Number | Number of cells

### public getClearFilterText(colIndex: Number): String source

Returns clear all text for specified filter column

#### Params:

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

#### Return:

String

### public getColValues(colIndex: Number, includeHeaders: Boolean, typed: Boolean, exclude: Array): Array source

Return the data of a specified column

#### Params:

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

includeHeaders

Boolean

- optional
- default: false

Include headers row

typed

Boolean

- optional
- default: true

Return a typed value

exclude

Array

- optional
- default: []

List of row indexes to be excluded

#### Return:

Array | Flat list of data for a column

### public getColumnIndexFromFilterId(filterId: string): Number source

Return the column index for a given filter ID

#### Params:

Name | Type | Attribute | Description

filterId

string

- optional
- default: ''

Filter ID

#### Return:

Number | Column index

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

Returns an array [[value0, value1 ...],[text0, text1 ...]] with the custom options values and texts

#### Params:

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

#### Return:

Array

### public getFilterElement(index: Number): DOMElement source

Return the filter's DOM element for a given column

#### Params:

Name | Type | Attribute | Description
index | Number |  | Column's index

#### Return:

DOMElement

### public getFilterId(index: Number): String source

Return the ID of a specified column's filter

#### Params:

Name | Type | Attribute | Description
index | Number |  | Column's index

#### Return:

String | ID of the filter element

### public getFilterType(colIndex: Number): String source

Return the filter type for a specified column

#### Params:

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

#### Return:

String

### public getFilterValue(index: Number): String source

Return the filter's value of a specified column

#### Params:

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

#### Return:

String | Filter value

### public getFilterableRowsNb(): Number source

Get the total number of filterable rows

#### Return:

Number

### public getFilteredData(includeHeaders: Boolean, excludeHiddenCols: Boolean, typed: Boolean): Array source

Return the filtered data with following format: [ [rowIndex, [value0, value1...]], [rowIndex, [value0, value1...]] ]

#### Params:

Name | Type | Attribute | Description

includeHeaders

Boolean

- optional
- default: false

Include headers row

excludeHiddenCols

Boolean

- optional
- default: false

Exclude hidden columns

typed

Boolean

- optional
- default: false

Return typed value

#### Return:

Array | TODO: provide an API returning data in JSON format

### public getFilteredDataCol(colIndex: Number, includeHeaders: Boolean, typed: Boolean, exclude: Array, visible: Boolean): Array source

Return the filtered data for a given column index

#### Params:

Name | Type | Attribute | Description
colIndex | Number |  | Colmun's index

includeHeaders

Boolean

- optional
- default: false

Include headers row

typed

Boolean

- optional
- default: false

Return typed value

exclude

Array

- optional
- default: []

List of row indexes to be excluded

visible

Boolean

- optional
- default: true

Return only filtered and visible data (relevant for paging)

#### Return:

Array | Flat list of values ['val0','val1','val2'...] TODO: provide an API returning data in JSON format

### public getFiltersByType(type: String, bool: Boolean): [type] source

Return the list of ids of filters matching a specified type. Note: hidden filters are also returned

#### Params:

Name | Type | Attribute | Description
type | String |  | Filter type string ('input', 'select', 'multiple', 'checklist')
bool | Boolean |  | If true returns columns indexes instead of IDs

#### Return:

[type] | List of element IDs or column indexes

### public getFiltersId(): [type] source

Get list of filter IDs

#### Return:

[type] | [description]

### public getFiltersRowIndex(): Number source

Get the index of the row containing the filters

#### Return:

Number

### public getFiltersValue(): Array source

Return the filters' values

#### Return:

Array | List of filters' values

### public getHeaderElement(colIndex: Number): Element source

Get the header DOM element for a given column index

#### Params:

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

#### Return:

Element

### public getHeadersRowIndex(): Number source

Get the index of the headers row

#### Return:

Number

### public getHeadersText(excludeHiddenCols: Boolean): Array source

Return the list of headers' text

#### Params:

Name | Type | Attribute | Description
excludeHiddenCols | Boolean |  | Optional: exclude hidden columns

#### Return:

Array | list of headers' text

### public getLastRowIndex(): Number source

Get the index of the last row

#### Return:

Number

### public getRowDisplay(row: HTMLTableRowElement): String source

Get the display value of a row

#### Params:

Name | Type | Attribute | Description
row | HTMLTableRowElement |  | DOM element of the row

#### Return:

String | Usually 'none' or ''

### public getRowsNb(includeHeaders: Boolean): Number source

Return the number of filterable rows starting from reference row if defined

#### Params:

Name | Type | Attribute | Description
includeHeaders | Boolean |  | Include the headers row

#### Return:

Number | Number of filterable rows

### public getStartRowIndex(): Number source

Get the row index from where the filtering process start (1st filterable row)

#### Return:

Number

### public getStylesheet(name: string): DOMElement source

Return stylesheet DOM element for a given theme name

#### Params:

Name | Type | Attribute | Description

name

string

- optional
- default: default

#### Return:

DOMElement | stylesheet element

### public getTableData(includeHeaders: Boolean, excludeHiddenCols: Boolean, typed: Boolean): Array source

Return the table data with following format: [ [rowIndex, [value0, value1...]], [rowIndex, [value0, value1...]] ]

#### Params:

Name | Type | Attribute | Description

includeHeaders

Boolean

- optional
- default: false

Include headers row

excludeHiddenCols

Boolean

- optional
- default: false

Exclude hidden columns

typed

Boolean

- optional
- default: false

Return typed value

#### Return:

Array | TODO: provide an API returning data in JSON format

### public getValidRows(reCalc: Boolean): Array source

Get filtered (valid) rows indexes

#### Params:

Name | Type | Attribute | Description
reCalc | Boolean |  | Force calculation of filtered rows list

#### Return:

Array | List of row indexes

### public getValidRowsNb(reCalc: Boolean): Number source

Return the total number of valid rows

#### Params:

Name | Type | Attribute | Description

reCalc

Boolean

- optional
- default: false

Forces calculation of filtered rows

#### Return:

Number

### public hasExtension(name: String): Boolean source

Check passed extension name exists

#### Params:

Name | Type | Attribute | Description
name | String |  | Name of the extension

#### Return:

Boolean

### public hasType(colIndex: Number, types: Array): Boolean source

Determine whether the specified column has one of the passed types

#### Params:

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

types

Array

- optional
- default: []

List of column types

#### Return:

Boolean

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

Checks if specified column filter ignores diacritics. Note this is only applicable to input filter types.

#### Params:

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

#### Return:

Boolean

### public import(fileId: String, filePath: String, callback: Function, type: String) source

Import script or stylesheet

#### Params:

Name | Type | Attribute | Description
fileId | String |  | Ressource ID
filePath | String |  | Ressource path
callback | Function |  | Callback
type | String |  | Possible values: 'script' or 'link'

### public init() source

Initialise features and layout

### public initExtensions() source

Initialise all the extensions defined in the configuration object

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

Check if given column implements a filter with custom options

#### Params:

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

#### Return:

Boolean

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

Determines if passed filter column implements exact query match

#### Params:

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

#### Return:

Boolean

### public isImported(filePath: String, type: String): Boolean source

Check if passed script or stylesheet is already imported

#### Params:

Name | Type | Attribute | Description
filePath | String |  | Ressource path
type | String |  | Possible values: 'script' or 'link'

#### Return:

Boolean

### public isInitialized(): Boolean source

Check if table has filters grid

#### Return:

Boolean

### public isRowDisplayed(rowIndex: Number): Boolean source

Checks if passed row is visible

#### Params:

Name | Type | Attribute | Description
rowIndex | Number |  | Row index

#### Return:

Boolean

### public isRowValid(rowIndex: Number): Boolean source

Checks if passed row is valid

#### Params:

Name | Type | Attribute | Description
rowIndex | Number |  | Row index

#### Return:

Boolean

### public linkFilters() source

Refresh the filters subject to linking ('select', 'multiple', 'checklist' type)

### public loadExtension(ext: Object) source

Load an extension module

#### Params:

Name | Type | Attribute | Description
ext | Object |  | Extension config object

### public loadThemes() source

Load themes defined in the configuration object

### public markActiveColumn(colIndex: Number) source

Mark currently filtered column

#### Params:

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

### public onInpBlur() source

Filter's blur event: if auto-filter on, clear interval on filter blur

### public onInpFocus(evt: Event) source

Filter's focus event

#### Params:

Name | Type | Attribute | Description
evt | Event |  |

### public onKeyDown() source

Filter's keydown event: if auto-filter on, detect user is typing

### public onKeyUp(evt: Event) source

Filter's keyup event: if auto-filter on, detect user is typing and filter columns

#### Params:

Name | Type | Attribute | Description
evt | Event |  |

### public removeExternalFlts() source

Remove all the external column filters

### public removeToolbar() source

Remove toolbar container element

### public setActiveFilterId(filterId: String) source

Set the ID of the current active filter

#### Params:

Name | Type | Attribute | Description
filterId | String |  | Element ID

### public setColWidths(tbl: Element) source

Set them columns' widths as per configuration

#### Params:

Name | Type | Attribute | Description
tbl | Element |  | DOM element

### public setFilterValue(index: Number, query: String or Array) source

Set search value to a given filter

#### Params:

Name | Type | Attribute | Description
index | Number |  | Column's index
query | String or Array |  | searcharg Search term

### public setToolbar() source

Generate container element for paging, reset button, rows counter etc.

### public validateAllRows() source

Validate all filterable rows

### public validateRow(rowIndex: Number, isValid: Boolean) source

Validate/invalidate row by setting the 'validRow' attribute on the row

#### Params:

Name | Type | Attribute | Description
rowIndex | Number |  | Index of the row
isValid | Boolean |  |