Support inserting row/column defs at specific indices rather than always appending
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.8k
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
#### What are you trying to do?
I'm trying to make table with 2 sticky header rows. First row should contain toolbar with table actions, but definition of this row is in separated file, it is passed through `cdkTable.addHeaderRowDef` . Second row should contain descriptions of columns.
#### What troubleshooting steps have you tried?
I tried to manually position `headerRowDefinition` inside `_headerRowDefs` property, but I'm unable to do that due to:
https://github.com/angular/components/blob/d3deb8b9c61f79f6a4ab75d74914aac3b43592bf/src/cdk/table/table.ts#L895
contentHeaderRowDefinitions specified explicit as content are always before customHeaderRowDefinitions added via `addHeaderRowDef`.
I tried to handle stickness by styling headers `postion: sticky` and calculate top positioning, but I'm unable to do that due to: https://github.com/angular/components/blob/d3deb8b9c61f79f6a4ab75d74914aac3b43592bf/src/cdk/table/table.ts#L731
All header rows have cleared top positioning value that I set via styling.
#### Reproduction
https://stackblitz.com/edit/angular-bkarpk?file=src/app/table/table.component.html
#### Environment
- Angular: 11.1.1
- CDK/Material: 11.1.1
- Browser(s): Chrome/Firefox
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
Beitragsleitfaden
Rechercherichtung
Beginne mit den verlinkten Abschnitten von src/cdk/table/table.ts und führe die bereitgestellte StackBlitz-Reproduktion aus. Verfolge, wie Inhalte und benutzerdefinierte Kopfzeilendefinitionen angeordnet werden und wie die Positionierung fixierter Kopfzeilen zurückgesetzt wird. Fertig ist die Aufgabe, wenn Kopfzeilendefinitionen am angeforderten Index erscheinen können und die beiden fixierten Kopfzeilen ihre korrekte Positionierung beibehalten.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, typescript
- Bereich
- frontend
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 30/100