Skip to content

Inconsistent API for column indexes #3906

@sergeyteleshev

Description

@sergeyteleshev

Description

There is an inconsistency in the API related to how column and row indexes are passed or returned in specific methods.
Some methods (for example: selectCell) provide or expect only the column/row index, rather than the original column identifier.
This causes issues when the grid’s internal state changes, such as when columns are pinned.
As a result, the indices can differ from the original ones that were passed into the grid, and it becomes impossible to determine from the outside which column index refers to.

Issue Details

  • There is no reliable way to map the given index back to a specific column outside the grid.
  • This makes it difficult to synchronize or manage external state related to columns.

Expected Behavior

The API should provide a consistent way to identify columns, regardless of internal reordering.

Actual Behavior

When the grid updates its internal state (due to sorting, pinning, etc.), previously valid indexes no longer refer to the same columns or rows, breaking external logic that relies on them.

Example

  1. Pass data with three columns: A, B, C.
  2. Pin column B.
  3. Call selectCell({idx: 2, rowIdx: 1);
    Expected behavior: selected 1st cell of the pinned column B
    Current behavior: selected 1st cell of column A

Suggested Fix

Standardize the API to use original column indices

Could you help us solve the issue or suggest an alternative approach to nail it?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions