angular / angular/components

feat(Mat-Table): Allow for adding multiple TBODY within Mat-Table

Aperta
#28,195 1 commento 5 reazioni 0 assegnatari Vedi su GitHub
area: cdk/table feature P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

### Feature Description

In the current cdk Table implementation we can only have on `` with a `matRowDef`. This will generate a TBODY element with the TR's inside.
That works fine for most use case.

I would like to be able to add a second TBODY with a selection of the rows of the datasource (based on a filter) so that I have 2 groups of rows within the same table.

I tried using the When option in matRowDef but that doesn't result in 2 TBODY's, but it comes close into what I am looking for.

### Use Case

I am having a list of Categories of which the top 3 can have primary flag. Those are display at the top, then row 4 until X is the non primary Categories.
I enabled drag and drop and I only want to be able to order the Primary rows within their TBODY and the non-primary rows in their TBODY. So you can't accidentally drop a Non primary row into a primary block.

You can control if a category is primary or not by editing the Category itself.

So to sum up feature request:

- Allow for multiple TBODYs which can have a filtered collection of the datasource
- Allow Drag and drop within that tbody only
image

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con l’implementazione di CDK Table e l’opzione matRowDef When per capire come viene generato l’attuale unico TBODY. Definisci come devono essere renderizzati più gruppi di datasource filtrati e come il trascinamento deve rimanere all’interno di ogni TBODY; il lavoro è completato quando entrambi i comportamenti funzionano per i gruppi di categorie primari e non primari descritti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.