Options

Editor has a number of options which can be configured using the initialisation object that is passed into the DataTable.Editor() constructor when creating a new Editor instance. This section details all of these options, with code examples of how each option can be used.

An example initialisation using the ajax and table options:

new DataTable.Editor( {
    ajax:  '/api/staff',
    table: '#staff'
} );

There are a number of options which can be used to customise your Editor instances, which are all fully documented below. For general information about how Editor's initialisation options can be used, please refer to the options manual.

Library Name Summary
Core

actionName

Change the parameter name used to indicate the CRUD action on form submission

Core

ajax

Ajax configuration for form data submission

Core

ajax.data

Add or modify data submitted to the server upon an Ajax request

Core

ajax.deleteBody

Allow a DELETE Ajax request to have a body or not

Core

ajax.replacements

Specify replacement parameters for the URL per submission

Core

display

Set the display controller for the main form interface

Core

fields

Fields to add to the form during initialisation

Core

formOptions

Form configuration options for the editing types Editor offers

Core

formOptions.bubble

Form configuration options for bubble editing

Core

formOptions.inline

Form configuration options for inline editing

Core

formOptions.main

Form configuration options for the main editing display

Core

idSrc

JSON property from which to read / write the row's ID property

Core

table

The DataTable that Editor will operate on

Core

template

Form layout template

Field

fields.className

Add an additional class to a field container

Field

fields.compare

Define a custom comparison function for the field's data

Field

fields.data

Data property from the data source object to use as the data for this field

Field

fields.def

Default value for the field to take

Field

fields.entityDecode

Control the decoding of HTML entities in input elements

Field

fields.fieldInfo

Information text that is shown below the input control.

Field

fields.getFormatter

Define a function that can transform a value being read from a field

Field

fields.id

Field ID

Field

fields.label

Label to display for the field input

Field

fields.labelInfo

Information text that is shown below the field label

Field

fields.message

Information message that is shown below the input control.

Field

fields.multiEditable

Control the end user's ability to edit the field when multiple rows are selected.

Field

fields.name

Unique name of the field - sent to the server on form submission

Field

fields.nullDefault

Replace null values with the field's default on edit.

Field

fields.options

List of options for fields which provide options to select from

Field

fields.optionsPair

Properties that Editor should use for label and values for options

Field

fields.setFormatter

Define a function that can transform a value being set in a field

Field

fields.submit

Define if the field's value should be included in the submitted data

Field

fields.type

Field input type

Internationalisation

i18n

Language configuration options for Editor

Internationalisation

i18n.close

Close button title text

Internationalisation

i18n.create

Create display language options

Internationalisation

i18n.create.button

Create button text

Internationalisation

i18n.create.message

Message shown at the top of the "create" form

Internationalisation

i18n.create.submit

Create display submit button text

Internationalisation

i18n.create.title

Create display title text

Internationalisation

i18n.datetime

Date time field input language options

Internationalisation

i18n.datetime.amPm

Time picker ante meridiem / post meridiem (am / pm) text

Internationalisation

i18n.datetime.months

Date picker month names

Internationalisation

i18n.datetime.next

Next month button text (hidden by default)

Internationalisation

i18n.datetime.previous

Previous month button text (hidden by default)

Internationalisation

i18n.datetime.unknown

Time picker unknown value

Internationalisation

i18n.datetime.weekdays

Date picker week day names

Internationalisation

i18n.edit

Edit display language options

Internationalisation

i18n.edit.button

Edit button text

Internationalisation

i18n.edit.message

Message shown at the top of the "edit" form

Internationalisation

i18n.edit.submit

Edit display submit button text

Internationalisation

i18n.edit.title

Edit display title text

Internationalisation

i18n.error

Error message language options

Internationalisation

i18n.error.system

General error message language string

Internationalisation

i18n.multi

Multi-row editing language options

Internationalisation

i18n.multi.info

Information text detailing the multi-row editing behaviour

Internationalisation

i18n.multi.noMulti

Information message shown when multi-row editing, but a field is not multi-row editable

Internationalisation

i18n.multi.restore

Button to restore multiple values if multi-row editing

Internationalisation

i18n.multi.title

Text to show to the end user when a field has multiple values

Internationalisation

i18n.remove

Remove display language options

Internationalisation

i18n.remove.button

Remove button text

Internationalisation

i18n.remove.confirm

Row deletion confirmation message

Internationalisation

i18n.remove.submit

Remove display submit button text

Internationalisation

i18n.remove.title

Remove display title text

Deprecated

ajaxUrl

Url to submit the Ajax form submission to. Deprecated - use ajax

Deprecated

dbTable

Unique table identifier string sent to the server. Deprecated - use ajax.data

Deprecated

domTable

The DataTable that Editor will operate on. Deprecated - use table