Class: Cell

FooTable.Cell

new Cell(table, row, column, valueOrElement) → {FooTable.Cell}

The cell class containing all the properties for cells.
This:
Parameters:
Name Type Description
table FooTable.Table The root FooTable.Table this cell belongs to.
row FooTable.Row The parent FooTable.Row this cell belongs to.
column FooTable.Column The FooTable.Column this cell falls under.
valueOrElement * | HTMLElement | jQuery Either the value or the element for the cell.
Returns:
Type
FooTable.Cell

Extends

Members

$detail :jQuery

The jQuery row object that represents this cell in the details table.
Type:

$el :jQuery

The jQuery table cell object this instance wraps.
Type:

(protected) classes :Array.<string>

An array of CSS classes for the cell.
Type:
  • Array.<string>

(readonly) column :FooTable.Column

The FooTable.Column this cell falls under.
Type:

(readonly) ft :FooTable.Table

The root FooTable.Table for the cell.
Type:

o :object

Contains any options for the cell. These are the options supplied through the plugin constructor as part of the row object itself.
Type:
  • object

(readonly) row :FooTable.Row

The parent FooTable.Row for the cell.
Type:

(protected) style :object

The inline styles for the cell.
Type:
  • object

value :*

The value of the cell.
Type:
  • *

Methods

(protected) $create()

After the cell has been defined this ensures that the $el and #detail properties are jQuery objects by either creating or updating them.
This:

(protected) collapse()

Collapses this cell and displays it in the details row.

(protected) define(valueOrElement)

This is supplied either the value or the cell element/jQuery object if it exists. If supplied the element we need set the $el property and parse the value from it.
This:
Parameters:
Name Type Description
valueOrElement * | jQuery The value or element to define the cell.

(protected) format(value) → {string|HTMLElement|jQuery}

Helper method to call this cell's column formatter function using the supplied value and any additional required parameters.
This:
Parameters:
Name Type Description
value * The value to format.
See:
Returns:
Type
string | HTMLElement | jQuery

(protected) parse() → {*}

Helper method to call this cell's column parser function supplying the required parameters.
This:
See:
Returns:
Type
*

(protected) restore()

Restores this cell from a detail row back into the normal row.

val(valueopt, redrawopt) → {*|undefined}

Allows easy access to getting or setting the cell's value. If the value is set all associated properties are also updated along with the actual element. Using this method also allows us to supply an object containing options and the value for the cell.
This:
Parameters:
Name Type Attributes Default Description
value * <optional>
The value to set for the cell. If not supplied the current value of the cell is returned.
redraw boolean <optional>
true Whether or not to redraw the row once the value has been set.
Returns:
Type
* | undefined