displayed()

Since: Editor 1.4

Get a list of the fields that are currently shown in the Editor form.
Please note - this property requires the Editor extension for DataTables.

Description

This method provides the ability to determine which field(s) are shown in an Editor form at any specific time. This gives a practical method for determining programmatically which fields are being edited when using generic event handlers - for example a specific field might require additional processing when inline editing.

Type

displayed()

List the fields which are currently shown in the editing form

Returns:

string[]:
Returns an array of strings, with each entry in the array being the name of a field.

Example

Trigger inline editing and update options for a specific field:

$('#myTable').on('click', 'td', function () {
	editor.inline(this);

	if (editor.displayed()[0] === 'position') {
		// Update list of position options
		editor.field('position').update(/* ... */);
	}
});