-
-
Notifications
You must be signed in to change notification settings - Fork 202
refactor: Add getRow helper to GridBody #8985
Copy link
Copy link
Closed
Labels
Description
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:
- Implement
Neo.grid.Body.getRow(record):- Find the record's index in the store.
- Verify the index is within the currently
mountedRowsrange. - Return the corresponding
Rowcomponent from the pool.
- Update Consumers: Refactor
Neo.grid.column.AnimatedChangeto 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.
Reactions are currently unavailable