Open jianliao opened 6 years ago
Also envountering this problem with a simple material datatable, has there been any progress?
I agree, this is a problematic behavior in a use case I deal with
Hi, is there any resolution to this issue as in my angular application, one of the pages is using material table module and matHeader related things and the other page is just using mat-table but no features related to matHeader and due to this, the page is breaking giving the error as "Missing definitions for header, footer and row...". Could anyone please reply with any resolution.
Bug, feature request, or proposal:
You got
Missing definitions for header and row, cannot determine which columns should be rendered
if you manually control changeDetection inWrapperTable
example.What is the expected behavior?
No error.
What is the current behavior?
It is very common that user want to control CD in his own code.
this.table.addColumnDef(...)
andthis.table.addRowDef(...)
called in ngAfterContentInit(...) are too late for this situation.What are the steps to reproduce?
Replace the content of file https://github.com/angular/material2/blob/master/src/demo-app/table/custom-table/wrapper-table.ts with my fork version: https://github.com/jianliao/material2/blob/master/src/demo-app/table/custom-table/wrapper-table.ts
Run
gulp serve:devapp
and navigate to http://localhost:4200/table/custom-table You got thisERROR Error: Missing definitions for header and row, cannot determine which columns should be rendered. at Object.getTableMissingRowDefsError (table-errors.ts:47) at MatTable.CdkTable.ngAfterContentChecked (table.ts:244) at callProviderLifecycles (provider.ts:558) at callElementProvidersLifecycles (provider.ts:534) at callLifecycleHooksChildrenFirst (provider.ts:522) at checkAndUpdateView (view.ts:365) at callWithDebugContext (services.ts:639) at Object.debugCheckAndUpdateView [as checkAndUpdateView] (services.ts:345) at ViewRef_.detectChanges (refs.ts:259) at WrapperTable.set [as columns] (wrapper-table.ts:53)
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Current latest Angular and Material library.
Is there anything else we should know?