display()

Since: Editor 1.3

Get / set the display state of the Editor form.
Please note - this property requires the Editor extension for DataTables.

Description

This method allows programmatic control of the display of the editing form, getting the current editing state, and having the ability to close all three built in editing form types, or to display the main editing form.

Note that also the get version of this method can tell you which of the three editing modes the form in currently in, the set call can only be used to open the main editing form (see open()).

Types

display()

Determine if the Editor form is currently displayed or not.

Returns:

string:
Returns false if there is no editing form currently displayed, or the current editing mode if there is one displayed. This will be the value of:

        * `string main`
        * `string bubble`
        * `string inline`

        based upon the editing mode that is currently being used.

display( show )

Show, or hide the main editing form. This is the same as calling open() or close().

Parameters:

Returns:

DataTable.Editor: Editor instance

Examples

Get the current editing mode:

var mode = editor.display();

if (mode) {
	alert('Currently in ' + mode + ' editing mode');
}
else {
	alert('Not editing');
}

Display a create edit form, after setting it up:

editor
	.create(false)
	.title('Create')
	.buttons('Save')
	.display(true);