Frontmatter
| id | 8985 |
| title | refactor: Add getRow helper to GridBody |
| state | Closed |
| labels | airefactoring |
| assignees | tobiu |
| createdAt | Feb 4, 2026, 2:28 PM |
| updatedAt | Feb 4, 2026, 2:33 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8985 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 8964 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Feb 4, 2026, 2:33 PM |
refactor: Add getRow helper to GridBody

tobiu
Feb 4, 2026, 2:32 PM
Input from Gemini 3 Pro:
✦ I have implemented the
getRowhelper and refactoredAnimatedChangeto use it.Changes:
src/grid/Body.mjs: AddedgetRow(record). This method encapsulates the logic for finding a row component:
- It retrieves the record index.
- It checks if the index is within the
mountedRowsrange (safety check).- It returns the recycled row component using modulo arithmetic on the pool size.
src/grid/column/AnimatedChange.mjs: Updated to usebody.getRow(record)instead of manual calculation. This is cleaner and safer.I have pushed the changes to the feature branch.
tobiu assigned to @tobiu on Feb 4, 2026, 2:33 PM
tobiu added parent issue #8964 on Feb 4, 2026, 2:33 PM
tobiu closed this issue on Feb 4, 2026, 2:33 PM
Objective: Refactor the logic for retrieving a
Neo.grid.Rowcomponent instance given a data record into a reusable helper methodgetRow(record)withinNeo.grid.Body.Current State:
Neo.grid.column.AnimatedChangemanually 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:
Neo.grid.Body.getRow(record):mountedRowsrange.Rowcomponent from the pool.Neo.grid.column.AnimatedChangeto use this new method.Benefits: