question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jelbourncommented, Feb 4, 2021

To clarify, the issue is that you can’t imperatively insert a header row such that it renders above the declarative row?

0reactions
pburgmercommented, Oct 27, 2022

I couldn’t find any workaround yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add new row to dataframe, at specific row-index, not appended?
Here's a solution that avoids the (often slow) rbind call: existingDF <- as.data.frame(matrix(seq(20),nrow=5,ncol=4)) r <- 3 newrow <- seq(4) insertRow ...
Read more >
Binding and Updating Column Definitions in ag-Grid
See how to set ag-Grid column definitions dynamically based on the columns in your row data. Get the example code in Angular, React,...
Read more >
Create indexes with included columns - SQL Server
This topic describes how to add included (or nonkey) columns to extend the functionality of nonclustered indexes in SQL Server by using SQL ......
Read more >
Documentation: 15: INSERT - PostgreSQL
INSERT inserts new rows into a table. One can insert one or more rows specified by value expressions, or zero or more rows...
Read more >
Excel INDEX MATCH vs. VLOOKUP - formula examples
See how to use INDEX MATCH in Excel as a more powerful VLOOKUP ... Excel INDEX can find the value at the juncture...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found