Skip to content

refactor: Add getRow helper to GridBody #8985

@tobiu

Description

@tobiu

Objective:
Refactor the logic for retrieving a Neo.grid.Row component instance given a data record into a reusable helper method getRow(record) within Neo.grid.Body.

Current State:
Neo.grid.column.AnimatedChange manually calculates the row index and accesses the body's item array using modulo arithmetic:

row = body.items[body.store.indexOf(record) % body.items.length]

Proposed Change:

  1. Implement Neo.grid.Body.getRow(record):
    • Find the record's index in the store.
    • Verify the index is within the currently mountedRows range.
    • Return the corresponding Row component from the pool.
  2. Update Consumers: Refactor Neo.grid.column.AnimatedChange to use this new method.

Benefits:

  • Encapsulation: Hides row pooling implementation details (modulo logic) from columns.
  • Safety: Ensures the returned row is actually currently mounted and assigned to the target record.
  • Reusability: Useful for other column types or controllers needing row access.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions