angular / angular/components

Support inserting row/column defs at specific indices rather than always appending

オープン
#21,791 コメント 7 件 リアクション 2 件 担当者 0 名 GitHub で見る
area: cdk/table feature P4
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

#### 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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

src/cdk/table/table.ts のリンクされたセクションから始め、提供された StackBlitz の再現を実行してください。コンテンツとカスタムヘッダー行定義がどのように順序付けられるか、また sticky ヘッダーの位置指定がどのように解除されるかを追跡してください。ヘッダー定義が要求されたインデックスに表示でき、2 つの sticky ヘッダー行が正しい位置指定を維持できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。