API

Editor has an extensive API which can be used to control and manipulate the form after the initialisation has completed. The Editor API is designed to reflect the structure of the data in the table and how you will typically interact with the table through the API.

The API is accessed as methods of the object returned when creating a new Editor instance:

  • new DataTable.Editor()

For general information on how the Editor API operates, including its chaining, how to manipulate the fields in the forum and definitions of the terminology used in this reference, please prefer to the API manual.

Library Name Summary
Display

ajax()

Get / set the Ajax configuration for the Editor

Display

blur()

Blur the currently displayed editor

Display

bubbleLocation()

Get / set the bubble location relative to the cell.

Display

bubblePosition()

Reposition an editing bubble when it is visible.

Display

buttons()

Define the control buttons to be shown in the form

Display

close()

Close the form display

Display

dependent()

Create a dependency on a field's value that can alter the form

Display

display()

Get / set the display state of the Editor form

Display

displayNode()

Get the host node for the display controller

Display

displayed()

Get a list of the fields that are currently shown in the Editor form

Display

error()

Show / hide error messages for the whole form, or a specific field

Display

file()

Get information about an uploaded file

Display

files()

Get information about multiple uploaded files

Display

message()

Show / hide an information message for the whole form, or a specific field

Display

open()

Display the main form editor to the end user

Display

order()

Get / set the ordering of fields, as they are displayed in the form

Display

template()

Get / set the template element to use for the main form

Display

title()

Get / set the title of the form

Display

undependent()

Remove existing dependent actions from a field

Editing

bubble()

Activate bubble editing

Editing

create()

Create a new item

Editing

destroy()

Destroy the Editor instance

Editing

edit()

Edit an item using the main editing display

Editing

ids()

Get the ids of the rows being edited

Editing

inline()

Activate inline editing

Editing

inlineCreate()

Create a row inline

Editing

mode()

Get / set the mode of operation the Editor form is currently in

Editing

modifier()

Get the identifier for the row(s) currently being edited / removed.

Editing

remove()

Remove (delete) entries from the table

Editing

submit()

Submit a form to the server for processing

Events

off()

Remove an event listener

Events

on()

Listen for an Editor event

Events

one()

Listen for an event once and then remove the listener

Fields

add()

Add a new field to the form

Fields

clear()

Remove one or more fields from the form

Fields

disable()

Disable one or more fields, disallowing user input

Fields

enable()

Enable one or more fields, allowing user input

Fields

field()

Get a field instance for a named field

Fields

get()

Get the value of one or more fields

Fields

hide()

Remove one or more fields from the form display

Fields

inError()

Determine if there is an error condition displayed in the form

Fields

node()

Get the container node for one or more fields

Fields

set()

Set the value of one or more fields

Fields

show()

Show one or more fields in the display that was previously hidden

Fields

val()

Get or set the value for one or more fields

Field instance methods

field().def()

Get / set the default value of the field

Field instance methods

field().disable()

Disable a field, disallowing user input

Field instance methods

field().displayed()

Determine if a field is shown in the editing form or not

Field instance methods

field().enable()

Enable a field, allowing user input

Field instance methods

field().enabled()

Determine if a field is enabled or not

Field instance methods

field().error()

Show / hide error messages for a field

Field instance methods

field().fieldInfo()

Get / set description information for the field

Field instance methods

field().focus()

Focus on a field

Field instance methods

field().get()

Get the value of a field

Field instance methods

field().hide()

Remove a field from the form display

Field instance methods

field().inError()

Check if a field is currently in an error state

Field instance methods

field().input()

Get the input node(s) for the field

Field instance methods

field().isMultiValue()

Determine if a field has different values for the items being edited

Field instance methods

field().label()

Get / set the label for a field

Field instance methods

field().labelInfo()

Get / set label information for the field

Field instance methods

field().message()

Get / set a dynamic information message for the field

Field instance methods

field().multiGet()

Get the values for a field (multi-row editing aware)

Field instance methods

field().multiRestore()

Restore the original values if edited to a single value

Field instance methods

field().multiSet()

Set the values for a field (multi-row editing aware)

Field instance methods

field().name()

Get a field's configured name

Field instance methods

field().node()

Get the container node for the field

Field instance methods

field().processing()

Show / hide processing indicator for an individual field

Field instance methods

field().set()

Set the value of a field

Field instance methods

field().show()

Show a field in the display that was previously hidden

Field instance methods

field().update()

Update the options available for list field types

Field instance methods

field().val()

Get / set the value of a field

Field instance methods

multiGet()

Get the values for one or more fields (multi-row editing aware)

Field instance methods

multiSet()

Set the values for one or more fields (multi-row editing aware)

Static methods

$.fn.dataTable.Editor.pairs()

Obtain label / value paired data from objects and arrays

Static methods

$.fn.dataTable.Editor.safeId()

Create an easy to use DOM id from an input string

Deprecated

fields()

Get a list of the field names configured.