field().submittable()

Since: Editor 2.4

Get / set the submit flag for a field.
Please note - this property requires the Editor extension for DataTables.

Description

field.submit can be used to indicate if a field should be included in the submission object or not. This API method provides the ability to change a field's submit flag dynamically after initialisation.

Note that this method is not called field().submit() as it is a flag and does not immediately trigger a submit of a form or field like submit() does.

Types

field(…).submit()

Get the submit flag for a field.

Returns:

boolean: Submittable flag

field(…).submittable( flag )

Set the submit flag for a field.

Parameters:

Returns:

DataTable.Editor.Field: Field instance

Example

Include a field in submission, which was initialised as not included:

var editor = new DataTable.Editor({
	ajax: '/api/staff',
	table: '#myTable',
	fields: [
		{
			label: 'Created:',
			name: 'created',
			submit: false
		},
		// ...
	]
});

// Later...
editor.field('created').submittable(true);

Related

The following options are directly related and may also be useful in your application development.