Page tree
Skip to end of metadata
Go to start of metadata

RELEASE 2.11.0 OR ABOVE

Returns the APIModels from the current Selection.


Parameters:

Name

Type

Attribute

Description

optionsObject

{

    skipUndoRedo: false,

    skipRendering: false

}

Set options for APIModel.

skipUndoRedoIf this value is true, the result of editing through the model is not undo/redo. Also the old undo/redo stack is initialized.

skipRenderingIf this value is true, the results of editing through the model are reflected only in the model and not rendered on the screen. After all edits are done, you need to render them separately via editor.render() method.


Return:

TypeDescription
Element[]Array of API models for editing


Example:

var paragraph = editor.getAPIModels()[0];
paragraph.append('<span>TEXT</span>');
skipUndoRedo : true
var paragraph = editor.getAPIModels({ skipUndoRedo : true })[0];
paragraph.append('<span>APPEND TEXT</span>');


skipRendering : true
var paragraph = editor.getAPIModels({ skipUndoRedo : true })[0];
paragraph.setText('TEXT');
paragraph.append('<span>APPEND TEXT</span>');
paragraph.prepend('<span>PREPEND TEXT</span>');

editor.render();
  • No labels