getAPIModelById
Release 2.11.0+
Returns the APIModel for editing via the API, looked up by ID.
Parameters
| Name | Type | Description |
|---|
id | string | Element id |
[options] | object | { skipUndoRedo: false, skipRendering: false } |
options
| Name | Type | Default | Description |
|---|
skipUndoRedo | boolean | false | When true, edits via this model are not pushed to the undo/redo stack. The existing undo/redo stack is also cleared. |
skipRendering | boolean | false | When true, edits are only applied to the model and not rendered. After all edits, call editor.render() separately. |
Returns
| Type | Description |
|---|
| Element | The API model for editing |
Example
var table = editor.getAPIModelById('ID');
table.insertCol(1);
table.insertRow(1);
table.setWidth(400);
var table = editor.getAPIModelById('ID', { skipUndoRedo: true });
table.insertCol(1);
table.insertRow(1);
table.setWidth(400);
var table = editor.getAPIModelById('ID', { skipRendering: true });
table.insertCol(1);
table.insertRow(1);
table.setWidth(400);
editor.render();