module:core/datafilter

module:core/datafilter

new (require("core/datafilter"))(filterSet, applyCallback)

Source:

Initialise the filter on the element with the given filterSet and callback.

Parameters:
Name Type Description
filterSet HTMLElement

The filter element.

applyCallback function

Callback function when updateTableFromFilter

Methods

(async) addFilter(filterRow, filterType, initialFilterValues, filterJoin, filterOptions) → {Filter}

Source:

Add a filter to the list of active filters, performing any necessary setup.

Parameters:
Name Type Description
filterRow HTMLElement
filterType String
initialFilterValues Array

The initially selected values for the filter

filterJoin String
filterOptions Object
Returns:
Type
Filter

addFilterRow(filterdata) → {Promise}

Source:

Add a filter row.

Parameters:
Name Type Description
filterdata Object

Optional, data for adding for row with an existing filter.

Returns:
Type
Promise

(async) getAvailableFilterLegends() → {array}

Source:

Fetch the strings used to populate the fieldset legends for the maximum number of filters possible.

Returns:
Type
array

getFilterDataSource(filterType) → {HTMLElement}

Source:

Get the filter data source node fro the specified filter type.

Parameters:
Name Type Description
filterType String
Returns:
Type
HTMLElement

getFilterObject(name) → {Object}

Source:

Get the registered filter class for the named filter.

Parameters:
Name Type Description
name String
Returns:

See the Filter class.

Type
Object

getFilterRegion() → {HTMLElement}

Source:

Get the filter list region.

Returns:
Type
HTMLElement

removeAllFilters() → {Promise}

Source:

Remove all filters.

Returns:
Type
Promise

removeEmptyFilters()

Source:

Remove any empty filters.

removeFilterObject(filterName)

Source:

Remove the Filter Object from the register.

Parameters:
Name Type Description
filterName string

The name of the filter to be removed

(async) removeFilterRow(filterRow, refreshContent)

Source:

Remove the specified filter row and associated class.

Parameters:
Name Type Default Description
filterRow HTMLElement
refreshContent Bool true

Whether to refresh the table content when removing

removeOrReplaceFilterRow(filterRow, refreshContent)

Source:

Remove or replace the specified filter row and associated class, ensuring that if there is only one filter row, that it is replaced instead of being removed.

Parameters:
Name Type Description
filterRow HTMLElement
refreshContent Bool

Whether to refresh the table content when removing

replaceFilterRow(filterRow, refreshContent, rowNum) → {Promise}

Source:

Replace the specified filter row with a new one.

Parameters:
Name Type Default Description
filterRow HTMLElement
refreshContent Bool true

Whether to refresh the table content when removing

rowNum Number 1

The number used to label the filter fieldset legend (eg Row 1). Defaults to 1 (the first filter).

Returns:
Type
Promise

updateFiltersOptions()

Source:

Update the list of filter types to filter out those already selected.

updateJoinList(filterJoinList, filterRow)

Source:

Update the list of join types for a filter.

This will update the list of join types based on the allowed types defined for a filter. If only one type is allowed, the list will be hidden.

Parameters:
Name Type Description
filterJoinList Array

Array of join types, a subset of the regularJoinList array in this function.

filterRow Element

The row being updated.

updateTableFromFilter()

Source:

Update the Dynamic table based upon the current filter.