Status | |||||
---|---|---|---|---|---|
|
...
|
...
|
에디터에서 Selection 정보를 반환합니다. Selection 정보는 아래와 같이 네가지 위치정보를 포함하고 있습니다Returns Selection information from the editor. Selection information includes four types of location information as follows.
종류 | 설명 |
---|---|
start |
The start position of the selection on the document | |
end | The end position of the Selection in the document |
anchor | The location where the selection started (ex; the location where the mouse was clicked in case of darting after clicking the mouse) |
focus | Location where selection is finished |
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
var selection = editor.getSelection(); var startPosition = selection.start; var endPosition = selection.end; var anchorPosition = selection.anchor; var focusPosition = selection.focus; |
또한 Selection은 선택된 컨텐츠의 종류에 따라 Also, Selection is divided into text, cell, drawingObject로 구분됩니다.
이 타입에 따라서 위치정보가 포함하고 있는 내용이 아래와 같이 다르게 구성됩니다and drawingObject according to the selected content type.
Depending on this type, the contents of location information are configured differently as follows.
type | position |
---|---|
text | id : |
Paragraph ID offset : |
Position of selection in paragraph | |
cell | id: |
First paragraph ID included in the cell offset : |
In the case of anchor position, the position where the selection started within the paragraph tableCellId : |
Cell ID tableId : |
Table ID | |
drawingObject | drawingObjectId : |
drawingObject ID id : |
Paragraph ID containing the drawingObject offset : |
...
Position of drawingObject in paragraph |
In Selection, type information can be checked as follows.
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
var selection = editor.getSelection(); var anchorType = selection.anchor.getType(); var focusType = selection.focus.getType(); |
...