vaadin / vaadin/framework

Feature: Grid: get/set cursor position

Open
#10,936 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement workaround
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

I would like to propose new feature for Grid.

When you click somewhere in the grid, the grid is showing a "cursor" - selected cell. You can move the cursor by arrow keys. The cursor is shown also when the grid selection mode is NONE.

It would be fine to be able to handle the cursor position programatically (get, set, listen to move event).

class GridCursorPosition {
    int columnIndex;
    int rowIndex;
};
GridCursorPosition p = grid.getCursorPosition();
grid.setCursorPosition(columnIndex, rowIndex);

Event CursorPositionChangeEvent and listener grid.addCursorPositionChangeEventListener(...).

Example: You can attach handler that reacts to cursor moves and displays special info according to currently selected cell.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the Grid implementation and its existing cursor, selection-mode, and keyboard-navigation entry points. Review how Grid state and events are exposed, then establish the get/set cursor API and cursor-position change listener described in the issue; done means programmatic reads, updates, and move notifications work.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.