In my application, I have a main component called Bill which includes a button for printing:
<button class="btn btn-primary" type="button" (click)="printBill()"> Print </button>
I also have a child component named BillProducts that contains a p-table:
<p-table [value]="products" [loading]="loading" [paginator]="allowPaginator" [rows]="1">
The goal is to hide the paginator and display all products when the user clicks on the print button.
printBill() {
this.allowPaginator = false;
window.print();
}
Unfortunately, what is currently happening is that the paginator gets hidden only after the document has been printed, not beforehand.
Does anyone have any suggestions on how to fix this issue?