[table] Allow columns to be hidden
See original GitHub issueBug, feature request, or proposal:
Feature request
What is the expected behavior?
It would be nice to change cdkColumnDef
to null
or undefined
programmatically to remove the column from the table
What is the current behavior?
Nothing occurs when you change the mat-header
or mat-cell
in mat-table
.
What are the steps to reproduce?
https://stackblitz.com/edit/material2-hide-columns
What is the use-case or motivation for changing an existing behavior?
This would allow me to write a generalized component for hiding sections of the datatable for certain screen sizes, allowing mobile data-tables to be better
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to hide columns in HTML table? - Stack Overflow
Here is the Jquery script for hide column. $('#hide-col').click(function () { $(".dynmic-hidden-col").hide(); });. This way the table column can be hidden ...
Read more >Show or hide table columns - HTML DOM
Show or hide table columns · Build the menu · Toggle the menu · Toggle table columns · Don't allow to hide the...
Read more >Hidden columns - DataTables example
Hidden columns. There are times when you might find it useful to display only a sub-set of the information that was available in...
Read more >Hide or show rows or columns - Microsoft Support
Right-click the selected columns, and then select Hide. Note: The double line between two columns is an indicator that you've hidden a column....
Read more >Hiding Columns - material-table/core
Hiding Columns · Hidden from being displayed in table. using the column.hidden prop · Hidden from the Columns Button (per column setting). using...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m incredibly dumb. Thank you @benb7760
@crutchcorn your class variable
displayColumns
is only set when you are initialising the class, and not getting updated when you call test. You could either update your test method to updatedisplayedColumns
or you could change it to a get accessorget displayedColumns() { return this.columns.map(c => c.columnDef); }