Skip to content

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

Open
@konossow

Description

@konossow

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:

this._headerRowDefs = mergeArrayAndSet(

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:

this._stickyStyler.clearStickyPositioning(headerRows, ['top']);

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: cdk/tablefeatureThis issue represents a new feature or feature request rather than a bug or bug fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions