Support inserting row/column defs at specific indices rather than always appending
- Lenguaje dominante
- TypeScript
- Estrellas
- 25k
- Forks
- 6.8k
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 91
Descripción
#### 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
Guía de contribución
Línea de trabajo
Comienza con las secciones enlazadas de src/cdk/table/table.ts y ejecuta la reproducción proporcionada en StackBlitz. Rastrea cómo se ordenan el contenido y las definiciones personalizadas de filas de encabezado, y cómo se elimina el posicionamiento fijo del encabezado. La tarea estará terminada cuando las definiciones de encabezado puedan aparecer en el índice solicitado y las dos filas de encabezado fijas conserven el posicionamiento correcto.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- angular, typescript
- Área
- frontend
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 30/100