Hierarchy

  • SelectionService

Implements

Constructors

Properties

anchor?: [number, number]

The cell a Shift+click or Shift+arrow range starts at (the last click, or the active cell).

Since

1.1.99

anchorRanges: CellRange[] = []

The ranges the anchor click (or the last shift-click) added – the next shift-click replaces them.

dragSnapshot?: SelectionSnapshot

The selection before a Ctrl/⌘-drag – each drag frame replaces only the dragged rectangle.

extent?: [number, number]

The moving corner of the range of Shift+arrows (Excel); undefined = the anchor.

Since

1.1.99

getFocusModel?: GetT<FocusModelIf>
getSelectionModel?: GetT<SelectionModelIf>
ignoreNextClick: boolean = false

A drag selection ends with a click on another cell – that click must not clear the new range.

previousEvt?: GeMouseEvent
tableScope: TableScope

Methods

  • Excel-style editing: the active cell moved (arrow keys, Tab, Enter) – the selection becomes this one cell and it is the new anchor. Selection types other than "range"/"cell" only get the anchor.

    Parameters

    • rowIndex: number

      display row index

    • columnIndex: number

      model column index

    Returns void

    Since

    1.1.99

  • Excel-style editing (Shift+arrows): the last range is spanned from the anchor to (rowIndex, columnIndex); other ranges (Ctrl/⌘-clicks) stay. Only for the selection type "range".

    Parameters

    • rowIndex: number

      the new moving corner (display row index)

    • columnIndex: number

      model column index

    Returns undefined | CellRange

    the new range, undefined without a range selection

    Since

    1.1.99

  • The cell a Shift+click or Shift+arrow range starts at: the last clicked cell or the active cell set by the keyboard (collapseTo).

    Returns undefined | [number, number]

    row and column, undefined before the first click/keyboard move

    Since

    1.1.99

  • The moving corner of the range Shift+arrows grow (the anchor if there is none).

    Returns undefined | [number, number]

    row and column

    Since

    1.1.99

  • Triggers an action based on the provided action ID.

    Parameters

    • actionId: "COPY_2_CLIPBOARD" | "START_EDITING" | "TOGGLE_SELECTION" | "SELECT_ALL" | "DESELECT_ALL" | "NAVIGATE_LEFT" | "NAVIGATE_RIGHT" | "NAVIGATE_UP" | "NAVIGATE_DOWN" | "NAVIGATE_ROW_START" | "NAVIGATE_ROW_END" | "NAVIGATE_FIRST_CELL" | "NAVIGATE_LAST_CELL" | "NAVIGATE_PAGE_UP" | "NAVIGATE_PAGE_DOWN" | "ACTIVATE_CELL" | "MOVE_ROW_UP" | "MOVE_ROW_DOWN" | "FILL_DOWN" | "FILL_RIGHT" | "NAVIGATE_NEXT_CELL" | "NAVIGATE_PREVIOUS_CELL" | "EXTEND_SELECTION_UP" | "EXTEND_SELECTION_DOWN" | "EXTEND_SELECTION_LEFT" | "EXTEND_SELECTION_RIGHT" | "EXTEND_SELECTION_ROW_START" | "EXTEND_SELECTION_ROW_END" | "EXTEND_SELECTION_PAGE_UP" | "EXTEND_SELECTION_PAGE_DOWN" | "NAVIGATE_DATA_EDGE_UP" | "NAVIGATE_DATA_EDGE_DOWN" | "NAVIGATE_DATA_EDGE_LEFT" | "NAVIGATE_DATA_EDGE_RIGHT" | "EXTEND_TO_DATA_EDGE_UP" | "EXTEND_TO_DATA_EDGE_DOWN" | "EXTEND_TO_DATA_EDGE_LEFT" | "EXTEND_TO_DATA_EDGE_RIGHT" | "SELECT_ROW" | "SELECT_COLUMN" | "CLEAR_CELLS" | "CLEAR_AND_EDIT" | "CUT_2_CLIPBOARD" | "PASTE_FROM_CLIPBOARD" | "UNDO" | "REDO"

      The ID of the action to be triggered.

    Returns boolean

    • Returns true if the action was successfully triggered; otherwise, false.
  • A click on a body cell: moves the focus and changes the selection.

    • plain click: new selection (the clicked cell, row or column – by selection type);
    • Shift: the rectangle from the previous click (the anchor) to this cell replaces what that click had selected – repeated Shift-clicks change the rectangle, ranges added before the anchor stay;
    • Ctrl/⌘: toggles the cell (row, column); Ctrl/⌘+Alt: deselects it.

    Header/footer clicks and the second click of a double click (clickCount 2) do not change selection or focus. All changes of one click are reported as one onSelectionChanged event.

    Parameters

    Returns boolean

    true if focus or selection changed (repaint needed)

  • Selects a range by dragging the mouse over body cells (selection type "range"). The cell where the drag started stays the anchor, so a following shift-click extends from there. With Ctrl/⌘ held at the start the dragged range is added to the existing selection, otherwise it replaces it.

    Parameters

    • evt: GeMouseEvent

      the current mouse position

    • startEvt: undefined | GeMouseEvent

      the mouse down event that started the drag

    Returns boolean

    true if the selection changed (repaint needed)