JSDoc: Class: Editing

# Class: Editing

## FooTable.Editing

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

The editing component adds a column with edit and delete buttons to each row as well as a single add row button in the footer.

##### Parameters:

Name | Type | Description
--- | --- | ---
`table` | FooTable.Table | The parent `FooTable.Table` object for the component.

##### Returns:

Type
  FooTable.Editing

### Extends

- FooTable.Component

### Members

#### addText :string

The text that appears in the add button. This can contain HTML.

##### Type:

- string

#### alwaysShow :boolean

Whether or not the editing column and add row button are always visible.

##### Type:

- boolean

#### callbacks :object

This object is used to contain the callbacks for the add, edit and delete row buttons.

##### Type:

- object

##### Properties:

Name | Type | Description
--- | --- | ---
`addRow` | function |
`editRow` | function |
`deleteRow` | function |

#### column :object

The options for the editing column. @see `FooTable.EditingColumn` for more info.

##### Type:

- object

##### Properties:

Name | Type | Default | Description
--- | --- | --- | ---
`classes` | string | "footable-editing" | A space separated string of class names to apply to all cells in the column.
`name` | string | "editing" | The name of the column.
`title` | string | "" | The title displayed in the header row of the table for the column.
`filterable` | boolean | false | Whether or not the column should be filterable when using the filtering component.
`sortable` | boolean | false | Whether or not the column should be sortable when using the sorting component.

#### deleteText :string

The text that appears in the delete button. This can contain HTML.

##### Type:

- string

#### editText :string

The text that appears in the edit button. This can contain HTML.

##### 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

#### ft :FooTable.Table

The parent `FooTable.Table` for the component.

##### Type:

- FooTable.Table

Inherited From:
  - FooTable.Component#ft

#### hideText :string

The text that appears in the hide button. This can contain HTML.

##### Type:

- string

#### pageToNew :boolean

Whether or not to automatically page to a new row when it is added to the table.

##### Type:

- boolean

#### position :string

The position of the editing column in the table as well as the alignment of the buttons.

##### Type:

- string

#### showText :string

The text that appears in the show button. This can contain HTML.

##### Type:

- string

### Methods

#### (static) draw()

Performs the drawing of the component.

#### (protected) $buttonAdd() → {string|HTMLElement|jQuery}

Creates the add button for the editing component.

##### Returns:

Type
  string | HTMLElement | jQuery

#### (protected) $buttonDelete() → {string|HTMLElement|jQuery}

Creates the delete button for the editing component.

##### Returns:

Type
  string | HTMLElement | jQuery

#### (protected) $buttonEdit() → {string|HTMLElement|jQuery}

Creates the edit button for the editing component.

##### Returns:

Type
  string | HTMLElement | jQuery

#### (protected) $buttonHide() → {string|HTMLElement|jQuery}

Creates the hide button for the editing component.

##### Returns:

Type
  string | HTMLElement | jQuery

#### (protected) $buttonShow() → {string|HTMLElement|jQuery}

Creates the show button for the editing component.

##### Returns:

Type
  string | HTMLElement | jQuery

#### (protected) $create()

Creates the editing UI from the current options setting the various jQuery properties of this component.

#### (protected) $rowButtons() → {string|HTMLElement|jQuery}

Creates the button group for the row buttons.

##### Returns:

Type
  string | HTMLElement | jQuery

#### (private) _onAddClick(e)

Handles the add button click event.

##### Parameters:

Name | Type | Description
--- | --- | ---
`e` | jQuery.Event | The jQuery.Event object for the event.

##### Fires:

- FooTable.event:Editing"add.ft.editing"

#### (private) _onDeleteClick(e)

Handles the delete button click event.

##### Parameters:

Name | Type | Description
--- | --- | ---
`e` | jQuery.Event | The jQuery.Event object for the event.

##### Fires:

- FooTable.event:Editing"delete.ft.editing"

#### (private) _onEditClick(e)

Handles the edit button click event.

##### Parameters:

Name | Type | Description
--- | --- | ---
`e` | jQuery.Event | The jQuery.Event object for the event.

##### Fires:

- FooTable.event:Editing"edit.ft.editing"

#### (private) _onHideClick(e)

Handles the hide button click event.

##### Parameters:

Name | Type | Description
--- | --- | ---
`e` | jQuery.Event | The jQuery.Event object for the event.

##### Fires:

- FooTable.event:Editing"show.ft.editing"

#### (private) _onShowClick(e)

Handles the show button click event.

##### Parameters:

Name | Type | Description
--- | --- | ---
`e` | jQuery.Event | The jQuery.Event object for the event.

##### Fires:

- FooTable.event:Editing"show.ft.editing"

#### (protected) destroy()

Destroys the editing component removing any UI generated from the table.

Overrides:
  - FooTable.Component#destroy

##### Fires:

- FooTable.event:Editing"destroy.ft.editing"

#### (protected) draw()

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

Inherited From:
  - FooTable.Component#draw

#### (protected) init()

Initializes the editing component for the plugin using the supplied table and options.

Overrides:
  - FooTable.Component#init

##### Fires:

- FooTable.event:Editing"init.ft.editing"

#### (protected) postdraw()

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

Inherited From:
  - FooTable.Component#postdraw

#### (protected) predraw()

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

Inherited From:
  - FooTable.Component#predraw

#### (protected) preinit(data)

Checks the supplied data and options for the editing component.

##### Parameters:

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

Overrides:
  - FooTable.Component#preinit

##### Fires:

- FooTable.event:Editing"preinit.ft.editing"