module:core/datafilter

module:core/datafilter

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

Description:
  • Initialise the filter on the element with the given filterSet and callback.

Source:
Parameters:
Name Type Description
filterSet HTMLElement

The filter element.

applyCallback function

Callback function when updateTableFromFilter

Methods

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

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

Source:
Parameters:
Name Type Description
filterRow HTMLElement
filterType String
initialFilterValues Array

The initially selected values for the filter

Returns:
Type
Filter

addFilterRow() → {Promise}

Description:
  • Add an unselected filter row.

Source:
Returns:
Type
Promise

(async) getAvailableFilterLegends() → {array}

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

Source:
Returns:
Type
array

getFilterDataSource(filterType) → {HTMLElement}

Description:
  • Get the filter data source node fro the specified filter type.

Source:
Parameters:
Name Type Description
filterType String
Returns:
Type
HTMLElement

getFilterObject(name) → {Object}

Description:
  • Get the registered filter class for the named filter.

Source:
Parameters:
Name Type Description
name String
Returns:

See the Filter class.

Type
Object

getFilterRegion() → {HTMLElement}

Description:
  • Get the filter list region.

Source:
Returns:
Type
HTMLElement

removeAllFilters() → {Promise}

Description:
  • Remove all filters.

Source:
Returns:
Type
Promise

removeEmptyFilters()

Description:
  • Remove any empty filters.

Source:

removeFilterObject(filterName)

Description:
  • Remove the Filter Object from the register.

Source:
Parameters:
Name Type Description
filterName string

The name of the filter to be removed

(async) removeFilterRow(filterRow, refreshContent)

Description:
  • Remove the specified filter row and associated class.

Source:
Parameters:
Name Type Default Description
filterRow HTMLElement
refreshContent Bool true

Whether to refresh the table content when removing

removeOrReplaceFilterRow(filterRow, refreshContent)

Description:
  • 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.

Source:
Parameters:
Name Type Description
filterRow HTMLElement
refreshContent Bool

Whether to refresh the table content when removing

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

Description:
  • Replace the specified filter row with a new one.

Source:
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()

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

Source:

updateTableFromFilter()

Description:
  • Update the Dynamic table based upon the current filter.

Source: