Class: Column

FooTable.Column

new Column(instance, definition, typeopt) → {FooTable.Column}

The column class containing all the properties for columns. All members marked as "readonly" should not be used when defining FooTable.Defaults#columns.
This:
Parameters:
Name Type Attributes Description
instance FooTable.Table The parent FooTable.Table this component belongs to.
definition object An object containing all the properties to set for the column.
type string <optional>
The type of column, "text" by default.
Returns:
Type
FooTable.Column

Extends

Members

(readonly) $el :jQuery

The jQuery cell object for the column header.
Type:

classes :Array.<string>

The classes to apply to all cells in this column.
Type:
  • Array.<string>

(readonly) ft :FooTable.Table

The root FooTable.Table for the column.
Type:

hidden :boolean

Whether or not this column is hidden from view and appears in the details row.
Type:
  • boolean
Default Value:
  • false

(readonly) index :number

The index of the column in the table. This is set by the plugin during initialization.
Type:
  • number
Default Value:
  • -1

name :string

The name of the column. This name must correspond to the property name of the JSON row data.
Type:
  • string
Default Value:
  • null

style :object

The styles to apply to all cells in this column.
Type:
  • object

title :string

The title to display in the column header, this can be HTML.
Type:
  • string
Default Value:
  • null

(readonly) type :string

The type of data displayed by the column.
Type:
  • string

(readonly) virtual :boolean

Whether or not the column was parsed from a standard table row containing data instead of from an actual header row.
Type:
  • boolean

visible :boolean

Whether or not this column is completely hidden from view and will not appear in the details row.
Type:
  • boolean
Default Value:
  • true

Methods

(protected) $create()

After the column has been defined this ensures that the $el property is a jQuery object by either creating or updating the current value.
This:

(protected) createCell(row) → {FooTable.Cell}

Creates a cell for this column from the supplied FooTable.Row object. This allows different column types to return different types of cells.
This:
Parameters:
Name Type Description
row FooTable.Row The row to create the cell from.
Returns:
Type
FooTable.Cell

(protected) define(definition)

This is supplied the column definition in the form of a simple object created by merging options supplied via the plugin constructor with those parsed from the DOM.
This:
Parameters:
Name Type Description
definition object The object containing the column definition.

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

This is supplied the value retrieved from the FooTable.Column#parse function and must return a string, HTMLElement or jQuery object. The return value from this function is what is displayed in the cell in the table.
This:
Parameters:
Name Type Description
value string The value to format.
Returns:
Type
string | HTMLElement | jQuery

(protected) parser(valueOrElement) → {string}

This is supplied either the cell value or jQuery object to parse. Any value can be returned from this method and will be provided to the FooTable.Column#format function to generate the cell contents.
This:
Parameters:
Name Type Description
valueOrElement * | jQuery The value or jQuery cell object.
Returns:
Type
string