[CdkTable] expose _insertRow to derived classes
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
#### Bug, feature request, or proposal: proposal
#### What is the expected behavior?
`_insertRow` is visible to inheriting classes
#### What is the current behavior?
`_insertRow` is private
#### What is the use-case or motivation for changing an existing behavior?
In `_insertRow` the context is created (`RowContext`).
The row context is very useful as a metadata storage for the row, storing information about the row that helps when we want to create features that require state.
For example, flagging if the row is currently being edited, which cell is edited. If the row is being dragged or not etc...
This is also true for a specific cell, metadata for it can be saved on the row context.
#### Is there anything else we should know?
Because `_insertRow` calls `_renderRow`, which is also private, it will require exposing `_renderRow` as well, which is dont think is such a bad thing.
But, if we want to avoid that, maybe it will be better to expose a new protected method, `_createRowContext(data: T): RowContext ` that people can extend
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par lire les méthodes _insertRow et _renderRow de CdkTable et la manière dont RowContext est créé. Déterminez si les classes dérivées doivent accéder aux méthodes existantes ou à un point d’entrée protégé pour la création du contexte ; le travail est terminé lorsque l’API choisie prend en charge les métadonnées de ligne pour les classes dérivées sans laisser le comportement ambigu.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- frontend
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100