Code: Select all
<p-table [value]="customers" [lazy]="true" (onLazyLoad)="loadCustomersLazy($event)"
[paginator]="true" [rows]="10" [totalRecords]="totalRecords" [loading]="loading"
(onRowSelect)="onRowSelect($event)" selectionMode="single" dataKey="customerNumber"
[(selection)]="selectedCustomer" [resizableColumns]="true">
The master table has an Add button, and I want to use an empty Customer in the detail component. The Add button calls
Code: Select all
add() {
this.selectedCustomer = new Customer();
this.detailUrl = this.router.url + '/detail' ;
this.router.navigate([this.detailUrl]);
}