#

API Docs for: 3.10.3
Show: Inherited Protected Private Deprecated

# RecordsetFilter Class

Defined in: `recordset/js/recordset-filter.js:13`
Module: recordset-filter
Parent Module: recordset

Plugin that provides the ability to filter through a recordset. Uses the filter methods available on Y.Array (see arrayextras submodule) to filter the recordset.

- Index
- Methods

## Item Index

### Methods

- filter
- grep
- reject

## Methods

### `filter`

(

- `filter`
- `[value]`

)
Recordset

Defined in `recordset/js/recordset-filter.js:36`

Filter through the recordset with a custom filter function, or a key-value pair.

#### Parameters:

- `filter` Function | String

  A custom filter function or a string representing the key to filter by.

- `[value]` Any optional

  If filtering by key (filter is a string), further filter by a specific value.

#### Returns:

Recordset: A new filtered Recordset instance

### `grep`

(

- `pattern`

)
Recordset

Defined in `recordset/js/recordset-filter.js:81`

Iterates over the Recordset, returning a new Recordset of all the elements that match the supplied regular expression

#### Parameters:

- `pattern` RegExp

  The regular expression to test against each record.

#### Returns:

Recordset: A Recordset instance containing all the items in the collection that produce a match against the supplied regular expression. If no items match, an empty Recordset instance is returned.

### `reject`

(

- `filter`

)
Recordset

Defined in `recordset/js/recordset-filter.js:65`

The inverse of filter. Executes the supplied function on each item. Returns a new Recordset containing the items that the supplied function returned `false` for.

#### Parameters:

- `filter` Function

  A boolean function, executed on each item.

#### Returns:

Recordset: A new Recordset instance containing the items on which the supplied function returned false.