fields

Since: Editor 1.0

Fields to add to the form during initialisation.
Please note - this property requires the Editor extension for DataTables.

Description

This option provides the ability to configure an Editor instance with fields upon configuration. As with all fields in the Editor instance, these fields can be manipulated through the API, including removing them completely with the clear() method.

Fields can be configured after initialisation of the Editor instance using the add() method, and it is not a requirement that fields be specified during initialisation.

Type

array

An array of field-options objects. Each object in the array will create a field with the specified options.

Example

Create an Editor instance with fields immediately available:

var editor = new DataTable.Editor({
	ajax: 'php/staff.php',
	table: '#myTable',
	fields: [
		{
			label: 'User name:',
			name: 'username'
		}
		// More fields would typically be added here!
	]
});