Namespace: displayController

Ancestry: Editor » .models. » displayController

DataTables Editor v1.2.4 documentation

Navigation

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

Editor makes very few assumptions about how its form will actually be displayed to the end user (where in the DOM, interaction etc), instead focusing on providing form interaction controls only. To actually display a form in the browser we need to use a display controller, and then select which one we want to use at initialisation time using the display option. For example a display controller could display the form in a lightbox (as the default display controller does), it could completely empty the document and put only the form in place, ir could work with DataTables to use fnOpen / fnClose to show the form in a "details" row and so on.

Editor has two built-in display controllers ('lightbox' and 'envelope'), but others can readily be created and installed for use as plug-ins. When creating a display controller plug-in you must implement the methods in this control. Additionally when closing the display internally you must trigger a requestClose event which Editor will listen for and act upon (this allows Editor to ask the user if they are sure they want to close the form, for example).

Summary

Methods - static

<static> close(dte, fn)

Hide the form (remove it form the visual display in the document)

<static> init(dte) → {object}

Initialisation method, called by Editor when itself, initialises.

<static> open(dte, append, fn)

Display the form (add it to the visual display in the document)

Details

Methods - static

<static> close(dte, fn)

Hide the form (remove it form the visual display in the document)

Parameters:
Name Type Attributes Default Description
1
dteobject

The DataTables Editor instance that has requested the action - this allows access to the Editor API if required.

2
fnfunctionOptional

Callback function that is to be executed when the form has been hidden. Note that this parameter is optional.

<static> init(dte) → {object}

Initialisation method, called by Editor when itself, initialises.

Parameters:
Name Type Attributes Default Description
1
dteobject

The DataTables Editor instance that has requested the action - this allows access to the Editor API if required.

Returns:

The object that Editor will use to run the 'open' and 'close' methods against. If static methods are used then just return the object that holds the init, open and close methods, however, this allows the display to be created with a 'new' instance of an object is the display controller calls for that.

<static> open(dte, append, fn)

Display the form (add it to the visual display in the document)

Parameters:
Name Type Attributes Default Description
1
dteobject

The DataTables Editor instance that has requested the action - this allows access to the Editor API if required.

2
appendelement

The DOM node that contains the form to be displayed

3
fnfunctionOptional

Callback function that is to be executed when the form has been displayed. Note that this parameter is optional.