# Class: Rows

## FooTable.Rows

#### new Rows(table) → {FooTable.Rows}

The rows class contains all the logic for handling rows.

##### Parameters:

Name | Type | Description
--- | --- | ---
`table` | FooTable.Table | The parent `FooTable.Table` this component belongs to.

##### Returns:

Type
  FooTable.Rows

### Extends

- FooTable.Component

### Members

#### $empty :jQuery

The jQuery object that contains the empty row control.

##### Type:

- jQuery

#### (protected) all :Array.<FooTable.Row>

The base array of rows parsed from either the DOM or the constructor options. The `FooTable.Rows#current` member is populated with a shallow clone of this array during the predraw operation before any core or custom components are executed.

##### Type:

- Array.<FooTable.Row>

Default Value:
  - []

#### (protected) array :Array.<FooTable.Row>

The current working array of `FooTable.Row` objects.

##### Type:

- Array.<FooTable.Row>

Default Value:
  - []

#### (protected) destroy

This method is called from the `FooTable.Table#destroy` method.

Inherited From:
  - FooTable.Component#destroy

#### emptyString :string

The text to display when the table has no rows.

##### Type:

- string

#### enabled :boolean

Whether or not this component is enabled. Disabled components only have there preinit method called allowing for this value to be overridden.

##### Type:

- boolean

Inherited From:
  - FooTable.Component#enabled

#### expandFirst :boolean

Whether or not the first rows details are expanded by default when displayed on a device that hides any columns.

##### Type:

- boolean

#### ft :FooTable.Table

The parent `FooTable.Table` for the component.

##### Type:

- FooTable.Table

Inherited From:
  - FooTable.Component#ft

#### (protected) o :FooTable.Table#options

This provides a shortcut to the `FooTable.Table#options` object.

##### Type:

- FooTable.Table#options

#### showToggle :boolean

Whether or not to display a toggle in each row when it contains hidden columns.

##### Type:

- boolean

Default Value:
  - true

#### toggleColumn :string

Specifies which column the row toggle is appended to. Supports only two values; "first" and "last"

##### Type:

- string

#### toggleSelector :string

The CSS selector used to filter row click events. If the event.target property matches the selector the row will be toggled.

##### Type:

- string

Default Value:
  - "tr,td,.footable-toggle"

### Methods

#### (protected) draw()

Performs the actual drawing of the table rows.

Overrides:
  - FooTable.Component#draw

#### (protected) init()

Initializes the rows class using the supplied table and options.

Overrides:
  - FooTable.Component#init

##### Fires:

- FooTable.event:Rows"init.ft.rows"

#### (protected) parse() → {jQuery.Promise}

This parses the rows from either the tables rows or the supplied options.

##### Returns:

Type
  jQuery.Promise

#### (protected) parseFinalize(deferred, rows)

Used to finalize the parsing of rows it is supplied the parse deferred object which must be resolved with an array of `FooTable.Row` objects or rejected with an error.

##### Parameters:

Name | Type | Description
--- | --- | ---
`deferred` | jQuery.Deferred | The deferred object used for parsing.
`rows` | Array.<object> | jQuery | An array of row values and options or the jQuery object containing all rows.

#### (protected) postdraw()

This method is called from the `FooTable.Table#draw` method.

Inherited From:
  - FooTable.Component#postdraw

#### (protected) predraw()

Performs the predraw operations that are required including creating the shallow clone of the `FooTable.Rows#array` to work with.

Overrides:
  - FooTable.Component#predraw

#### (protected) preinit(data)

The columns preinit method is used to parse and check the column options supplied from both static content and through the constructor.

##### Parameters:

Name | Type | Description
--- | --- | ---
`data` | object | The jQuery data object from the root table element.

Overrides:
  - FooTable.Component#preinit

##### Fires:

- FooTable.event:Rows"preinit.ft.rows"