# Yahoo! UI Library

### recordset 3.3.0

Yahoo! UI Library > recordset > RecordsetFilter
Search:
Filters Show Private Show Protected Show Deprecated

## Class RecordsetFilter

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.

### Methods

#### filter

`Y.Recordset filter ( f , v )`
Filter through the recordset with a custom filter function, or a key-value pair.

Parameters:
  `f <Function, String>` A custom filter function or a string representing the key to filter by.
  `v <any>` (optional) If a string is passed into f, this represents the value that key should take in order to be accepted by the filter. Do not pass in anything if 'f' is a custom function

Returns: `Y.Recordset`
  recordset A new filtered recordset instance

#### grep

`Y.Recordset grep ( pattern )`
Iterates over the Recordset, returning a new Recordset of all the elements that match the supplied regular expression

Parameters:
  `pattern <pattern>` The regular expression to test against each record.

Returns: `Y.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

`Y.Recordset reject ( f )`
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:
  `f <Function>` is the function to execute on each item.

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

Copyright © 2011 Yahoo! Inc. All rights reserved.