Skip to content

Table with dynamic columns - footer / header does not update after context change #13030

Closed
@TiS

Description

@TiS

Bug, feature request, or proposal:

Bug

What is the expected behavior?

I define table using dynamic columns like below. In footer cell definition I am using some context object (from current component) and its values.

After context object is updated, table footer displays current data.

        <ng-container
            *ngFor="let month of months;"
            matColumnDef="p{{month}}"
        >
            <th mat-header-cell *matHeaderCellDef>
                {{month}}
            </th>
            <td
                mat-cell
                *matCellDef="let element"
            >
                        {{element.someValue}}
            </td>
            <td mat-footer-cell *matFooterCellDef>
                   {{someContextObject?.someValue}}
            </td>
        </ng-container>

What is the current behavior?

After updating context object, table footer does not show changes. It does not work even, if context variable is a simple string.

This works correctly, if table cell is not defined using *ngFor.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular Material 6.4.7

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions