Parent Class of all APIModel Elements. It provides the necessary properties and methods to manipulate the model.

Properties

id 

Element ID

type

Element Type

index

Current index

parent

Parent APIModel

nextSibling

Next Sibling APIModel

previousSibling

Previous Sibling APIModel

firstChild

First child APIModel

lastChild

Last child APIModel

children

Child APIModels (array)

siblings

Sibling APIModels (array)

nextSiblings

Next sibling APIModels (array)

previousSiblings

Previous sibling APIModels (array)

options

Options object

skipUndoRedo

편집시 undo, redo를 생략할지 여부

skipRendering

Whether to omit undo and redo when editing

Methods

closest(condition)

Returns the API model that meets the criteria among the parent API models.

var run = editor.getAPIModelById('id');
var body = run.closest(function(apiModel){
	return apiModel.type === 'Body';
});


setId(id)

Set ID.

var element = editor.getAPIModelById('id');
element.setId('test_setId');

setStyle(cssText)

Set style.

var element = editor.getAPIModelById('id');
element.setStyle('background-color: red;')

empty()

Remove child elements.

var element = editor.getAPIModelById('id');
element.empty();