angular / angular/components

feat(cdk/table): Possibility to add custom context to each row cell

Open
#29,533 0 comments 8 reactions 0 assignees View on GitHub
area: cdk/table area: material/table feature
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

### Feature Description

Currently, the only context passed to the cell is: count, first, last, even, odd. However, this only works properly without pagination. If the table has pagination, we're stuck with these basic variables that are only relative to the page in display and not relative to the whole dataset being used, under the hood.

I'd would suggest giving the possibility to customize this behaviour via an optional method that is called when you run "_updateRowIndexContext". This new optional method would receive the context object that you currently have and expand on it according to what each project requires.

### Use Case

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the Angular CDK table implementation containing _updateRowIndexContext and read how the current count, first, last, even, and odd context is built. Determine the optional customization API and add coverage for paginated rows; done means projects can extend the context with dataset-relative values without breaking the existing context.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.