Skip to content

paginatoe issue #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SofiiaPopadiuk opened this issue May 22, 2025 · 0 comments
Open

paginatoe issue #193

SofiiaPopadiuk opened this issue May 22, 2025 · 0 comments

Comments

@SofiiaPopadiuk
Copy link

SofiiaPopadiuk commented May 22, 2025

Hello @HalitTalha!

It seems we've encountered this issue before, but it's now reproducible for me again:
#2

In version 15.0.0 of the library, an error occurs when using mat-table without a mat-paginator.

I believe the fix would be quite simple — just add a check to ensure the paginator exists before attempting to enable or disable it.

Thanks for your work on this library!

Image

My code:

 <div (click)="exporter.exportTable('csv')">
    <i class="fas fa-solid fa-download mr-2"></i>
    Export
  </div>

  <table
    mat-table
    matTableExporter
    [dataSource]="dataSource()"
    #exporter="matTableExporter"
    [class.d-none]="!dataSource().data.length"
  >
   ...
    <tr mat-header-row *matHeaderRowDef="displayedColumns()"></tr>
    <tr mat-row *matRowDef="let row; columns: displayedColumns()"></tr>
    <tr mat-footer-row *matFooterRowDef="displayedColumns()"></tr>
  </table>
  dataSource = computed(() => new MatTableDataSource(this.tableData()?.rows));
  displayedColumns = computed(() => this.tableData()?.displayedColumns);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant