#

API Docs for: 3.10.3
Show: Inherited Protected Private Deprecated

# RecordsetIndexer Class

Defined in: `recordset/js/recordset-indexer.js:6`
Module: recordset-indexer
Parent Module: recordset

Plugin that provides the ability to store multiple custom hash tables referencing records in the recordset. This utility does not support any collision handling. New hash table entries with a used key overwrite older ones.

- Index
- Methods
- Attributes

## Item Index

### Methods

- _defAddHash
- _defRemoveHash
- _defUpdateHash
- _setHashTable
- createTable
- getTable

### Attributes

- hashTables

## Methods

### `_defAddHash`

() private

Defined in `recordset/js/recordset-indexer.js:86`

Updates all hash tables when a record is added to the recordset

### `_defRemoveHash`

() private

Defined in `recordset/js/recordset-indexer.js:111`

Updates all hash tables when a record is removed from the recordset

### `_defUpdateHash`

() private

Defined in `recordset/js/recordset-indexer.js:137`

Updates all hash tables when the recordset is updated (a combination of add and remove)

### `_setHashTable`

(

- `key`

)
Object private

Defined in `recordset/js/recordset-indexer.js:62`

Setup the hash table for a given key with all existing records in the recordset

#### Parameters:

- `key` String

  A key to hash by.

#### Returns:

Object: obj The created hash table

### `createTable`

(

- `key`

)
Object public

Defined in `recordset/js/recordset-indexer.js:187`

Creates a new hash table.

#### Parameters:

- `key` String

  A key to hash by.

#### Returns:

Object: tbls[key] The created hash table

### `getTable`

(

- `key`

)
Object public

Defined in `recordset/js/recordset-indexer.js:204`

Get a hash table that hashes records by a given key.

#### Parameters:

- `key` String

  A key to hash by.

#### Returns:

Object: table The created hash table

## Attributes

### `hashTables`

Object public

Defined in `recordset/js/recordset-indexer.js:21`

Collection of all the hashTables created by the plugin. The individual tables can be accessed by the key they are hashing against.

#### Fires event `hashTablesChange`

Fires when the value for the configuration attribute `hashTables` is changed. You can listen for the event using the `on` method if you wish to be notified before the attribute's value has changed, or using the `after` method if you wish to be notified after the attribute's value has changed.

#### Parameters:

- `e` EventFacade
  An Event Facade object with the following attribute-specific properties added:
  - `prevVal` Any
    The value of the attribute, prior to it being set.
  - `newVal` Any
    The value the attribute is to be set to.
  - `attrName` String
    The name of the attribute being set.
  - `subAttrName` String
    If setting a property within the attribute's value, the name of the sub-attribute property being set.