Namespace: field

Ancestry: Editor » .models. » field

DataTables Editor v1.2.4 documentation

Navigation

Hiding private elements (toggle)
Showing extended elements (toggle)

Object structure used to define a field (a user input control) in a form. The options shown here can provided to customise the field as required. All properties are optional with the exception of the name property which much be defined.

Summary

Properties - static

<static> className :string

Class name to assign to the field's container element (in addition to the other classes that Editor assigns by default).

<static> dataProp :string

The data property (mData in DataTables terminology) that is used to read from and write to the table. If not given then it will take the same value as the name that is given in the field object. Note that dataProp can be given as null, which will result in Editor not using a DataTables row property for the value of the field for either getting or setting data.

<static> dataSourceGet :function

Get the value of the field from the data source object. This allows deeply nested properties, or a function to be used, as well as regular immediate properties, in exactly the same way that DataTables using mData for columns. This should be used to get the value from a data source (i.e. a row object).

<static> dataSourceSet :function

Set the value of the field to the data source object (i.e. a row object). This allows deeply nested properties, or a function to be used, as well as regular immediate properties, in exactly the same way that DataTables using mData for columns. This should be used for setting the value of a property, when the data source will be passed on to DataTables.

<static> default :string

The default value for the field. Used when creating new rows (editing will use the currently set value).

<static> el :node

The field wrapper element - this element contains the DOM elements that are used for editing a given field

<static> fieldInfo :string

Helpful information text about the field that is shown below the input control.

<static> id :string

The ID of the field. This is used by the label HTML tag as the "for" attribute improved accessibility. Although this using this parameter is not mandatory, it is a good idea to assign the ID to the DOM element that is the input for the field (if this is applicable).

<static> label :string

The label to display for the field input (i.e. the name that is visually assigned to the field).

<static> labelInfo :string

Helpful information text about the field that is shown below the field label.

<static> name :string

The name for the field that is submitted to the server. This is the only mandatory parameter in the field description object.

<static> type :string

The input control that is presented to the end user. The options available are defined by Editor.fieldTypes and any extensions made to that object.

Details

Properties - static

<static> className :string

Class name to assign to the field's container element (in addition to the other classes that Editor assigns by default).

<static> dataProp :string

The data property (mData in DataTables terminology) that is used to read from and write to the table. If not given then it will take the same value as the name that is given in the field object. Note that dataProp can be given as null, which will result in Editor not using a DataTables row property for the value of the field for either getting or setting data.

<static> dataSourceGet :function

Get the value of the field from the data source object. This allows deeply nested properties, or a function to be used, as well as regular immediate properties, in exactly the same way that DataTables using mData for columns. This should be used to get the value from a data source (i.e. a row object).

Parameters:
Name Type Attributes Default Description
1
dataobject

The data source object to get the data from

2
typestring

The specific data type to be obtained (useful only if dataProp is given as a function) - should be "editor" for Editor specific actions.

Returns:

Value from the data source.

<static> dataSourceSet :function

Set the value of the field to the data source object (i.e. a row object). This allows deeply nested properties, or a function to be used, as well as regular immediate properties, in exactly the same way that DataTables using mData for columns. This should be used for setting the value of a property, when the data source will be passed on to DataTables.

Parameters:
Name Type Attributes Default Description
1
dataobject

The data source object to set the data on

2
val*

The value to set (dataProp will tell the function which property is to be set).

<static> default :string

The default value for the field. Used when creating new rows (editing will use the currently set value).

<static> el :node

The field wrapper element - this element contains the DOM elements that are used for editing a given field

<static> fieldInfo :string

Helpful information text about the field that is shown below the input control.

<static> id :string

The ID of the field. This is used by the label HTML tag as the "for" attribute improved accessibility. Although this using this parameter is not mandatory, it is a good idea to assign the ID to the DOM element that is the input for the field (if this is applicable).

<static> label :string

The label to display for the field input (i.e. the name that is visually assigned to the field).

<static> labelInfo :string

Helpful information text about the field that is shown below the field label.

<static> name :string

The name for the field that is submitted to the server. This is the only mandatory parameter in the field description object.

<static> type :string

The input control that is presented to the end user. The options available are defined by Editor.fieldTypes and any extensions made to that object.