Creates a data controller instance. Outside a plugin context, it is not
required to provide an editor
. From within a plugin context, providing
the editor
is expected.
Optional
editor: defaultoptional editor to bind to
Signals, if this data controller is in delegating mode.
Access editor, this instance is bound to.
Gets the data, possibly from cache either if the editor is not ready yet, or if the data are considered equal to the data set before.
options for retrieving data; note, that despite the
rootName
any other options are ignored if data are retrieved from cache.
Initialize controller, to possibly forward data already set. Outside
a plugin context, requires the editor
to be given. When used from within
a plugin, it is unnecessary to provide an editor. But if an editor is
provided, it must be the same as the original one when creating this
data controller instance.
Optional
editor: defaultoptional editor to bind to
Sets the data to set at editor. If the editor is not ready yet, data will be forwarded as soon as the editor is ready.
data to set
options for setting data
Controller for getting and setting data. It prefers providing data on get from the previously set data if no editorial actions have been applied so far.
The controller may be used in three modes: standalone, delegating, and embedded.
Standalone Mode
The standalone mode may be used if you create the CKEditor instance late and require to set and retrieve data already before. A standalone controller may at any time be turned into a delegating controller.
Embedded Mode
The embedded mode is controlled by
DataFacade
plugin. The plugin will maintain this embedded instance of the controller and use it when binding to theAutosave
plugin.Delegating Mode
A controller in standalone mode may (once) be turned into delegating mode. The setup requires the
DataFacade
plugin to be installed. The standalone controller will then bind to the controller held by theDataFacade
, propagate any possibly already set data and will only use delegate calls afterward.Recommended Mixed Setup
The recommended setup, if you require the controller in the standalone mode, is to switch to delegating mode, as soon as the editor is available. The control flow may be roughly sketched as follows: