SELECTION
Caret movement, selection extension, and selection control commands executed via editor.execCommand.
Commands
command - blurImecommand - disableImecommand - documentEndcommand - documentStartcommand - downcommand - enableImecommand - extendColcommand - extendDocumentEndcommand - extendDocumentStartcommand - extendDowncommand - extendLeftcommand - extendLineEndcommand - extendLineStartcommand - extendNextParagraphStartcommand - extendNextWordcommand - extendPageDowncommand - extendPageUpcommand - extendPreviousParagraphStartcommand - extendPreviousWordcommand - extendRightcommand - extendRowcommand - extendTablecommand - extendUpcommand - focusImecommand - leftcommand - lineEndcommand - lineStartcommand - nextParagraphStartcommand - nextWordcommand - pageDowncommand - pageUpcommand - previousParagraphStartcommand - previousWordcommand - rightcommand - selectAllcommand - selectParagraphcommand - selectWordcommand - setCaretcommand - setCaretByIdcommand - setSelectioncommand - setSelectionByHTMLElementcommand - up
command - blurIme
Removes focus from the editor.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('blurIme');
command - disableIme
Disables text input.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('disableIme');
command - documentEnd
Moves the caret to the end of the document.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('documentEnd');
command - documentStart
Moves the caret to the start of the document.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('documentStart');
command - down
Moves the caret down.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('down');
command - enableIme
Enables text input.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('enableIme');
command - extendCol
Selects the column at the given index in the table identified by tableId.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
tableId | string | Table id |
index | number | Column index |
isExtend | boolean | Whether to extend the existing selection |
editor.execCommand('extendCol', 'table_id', 0, false);
command - extendDocumentEnd
Extends the selection to the end of the document.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('extendDocumentEnd');
command - extendDocumentStart
Extends the selection to the start of the document.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('extendDocumentStart');
command - extendDown
Extends the selection downward.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('extendDown');
command - extendLeft
Extends the selection one position to the left.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('extendLeft');
command - extendLineEnd
Extends the selection to the end of the line.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('extendLineEnd');
command - extendLineStart
Extends the selection to the start of the line.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('extendLineStart');
command - extendNextParagraphStart
Extends the selection to the start of the next paragraph.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('extendNextParagraphStart');
command - extendNextWord
Extends the selection to the start of the next word.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('extendNextWord');
command - extendPageDown
Extends the selection down by one scroll page.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('extendPageDown');
command - extendPageUp
Extends the selection up by one scroll page.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('extendPageUp');
command - extendPreviousParagraphStart
Extends the selection to the start of the previous paragraph.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('extendPreviousParagraphStart');
command - extendPreviousWord
Extends the selection to the start of the previous word.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('extendPreviousWord');
command - extendRight
Extends the selection one position to the right.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('extendRight');
command - extendRow
Selects the row at the given index in the table identified by tableId.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
tableId | string | Table id |
index | number | Row index |
isExtend | boolean | Whether to extend the existing selection |
editor.execCommand('extendRow', 'table_id', 0, false);
command - extendTable
Selects the entire table identified by tableId.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
tableId | string | Table id |
editor.execCommand('extendTable', 'table_id');
command - extendUp
Extends the selection upward.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('extendUp');
command - focusIme
Moves focus to the editor.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
preventScroll | boolean | Whether to skip scrolling to the selection (default false) |
editor.execCommand('focusIme', false); // scroll to the selection
editor.execCommand('focusIme', true); // do not scroll
command - left
Moves the caret one position to the left.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('left');
command - lineEnd
Moves the caret to the end of the line.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('lineEnd');
command - lineStart
Moves the caret to the start of the line.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('lineStart');
command - nextParagraphStart
Moves the caret to the start of the next paragraph.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('nextParagraphStart');
command - nextWord
Moves the caret to the start of the next word.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('nextWord');
command - pageDown
Moves the caret down by one scroll page.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('pageDown');
command - pageUp
Moves the caret up by one scroll page.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('pageUp');
command - previousParagraphStart
Moves the caret to the start of the previous paragraph.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('previousParagraphStart');
command - previousWord
Moves the caret to the start of the previous word.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('previousWord');
command - right
Moves the caret one position to the right.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('right');
command - selectAll
Selects the entire document.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('selectAll');
command - selectParagraph
Selects the paragraph at the given screen coordinates.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
x | number | x coordinate (screen) |
y | number | y coordinate (screen) |
editor.execCommand('selectParagraph', 100, 100);
command - selectWord
Selects the word at the given screen coordinates.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
x | number | x coordinate (screen) |
y | number | y coordinate (screen) |
editor.execCommand('selectWord', 100, 100);
command - setCaret
Moves the caret to the given screen coordinates.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
x | number | x coordinate (screen) |
y | number | y coordinate (screen) |
editor.execCommand('setCaret', 100, 100);
command - setCaretById
Moves the caret to the paragraph identified by id, with the given offset.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
id | string | Paragraph id |
offset | number | Paragraph offset |
editor.execCommand('setCaretById', 'paragraph_id', 0);
command - setSelection
Moves the caret to the given coordinates or extends the selection.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
x | number | x coordinate (screen) |
y | number | y coordinate (screen) |
isExtend | boolean | Whether to extend the existing selection (default false) |
isFinish | boolean | Whether the selection is finished (default false). When finished, scrolling is adjusted. |
editor.execCommand('setSelection', 100, 100, false, true);
command - setSelectionByHTMLElement
Selects the given HTML element.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
htmlElement | HTMLElement | HTML element to select |
editor.execCommand('setSelectionByHTMLElement', document.getElementById('test'));
command - up
Moves the caret up.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('up');