Skip to content

GridTester has no way to deselect a row, and no Grid editor support #175

Description

@totally-not-ai

Problem. GridTester has select(int), selectAll() and getSelected(),
but no way to undo a selection. In the browser a user deselects by
ctrl-clicking a selected row in multi-select mode, by clicking the row's
checkbox again, by unchecking the select-all header checkbox, or by clicking
the selected row in single-select mode.

var grid = new GridTester<>(component);
grid.select(0);
// no deselect(0), no deselectAll()

The Kotlin layer already has the pieces — Grid._select calls
deselectAll() internally for single-select before
selectionModel.selectFromClient(item).

While in there, two related gaps:

  • Grid editor. Grid.getEditor() — the user double-clicks a row, edits the
    buffered fields and saves or cancels. There is no tester support for any of
    it. GridProTester.setValue covers GridPro's inline editing, but not the
    plain Grid editor.
  • selectAll() doesn't consider
    setSelectAllCheckboxVisibility(HIDDEN), even though the Kotlin
    Grid._selectAll Javadoc claims it "fails if ... the select all checkbox is
    hidden". If the checkbox isn't rendered there is no way for the user to
    trigger it. (Worth deciding deliberately — this is the feat: give every value tester a uniform clear() #168 question in
    reverse.)

Ask. Add deselect(int row) and deselectAll(), routed through the
selection model's from-client path like select(int) is. Decide on the
select-all-checkbox gate. Grid editor support can be split off if it's too big
for one PR.

Found while auditing the project against #153 / #168.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions