PrimeNG: 13.4.0 p-dropdown set default value

UI Components for Angular
Post Reply
ohiodeveloper
Posts: 2
Joined: 19 May 2022, 20:57

19 May 2022, 23:19

I am trying to populate a p-dropdown with country of origin data. I'd like to use a default value when the country of Origin in my import line is invalid relative to my list. Is there a way to include and select a default value?
<p-cellEditor>
<ng-template pTemplate="input" style="width: 30rem">
<p-dropdown appendTo="body" [(ngModel)]="line.countryOfOrigin" name="countryOfOrigin" [options]="countriesOfOriginGSACompliant" optionLabel="name" [filter]="true" filterBy="value" (onChange)="saveSelectedCountry($event.value, line.supplierSku)">
</p-dropdown>
</ng-template>
<ng-template pTemplate="output">
{{ line.countryOfOrigin }}
</ng-template>
</p-cellEditor>

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests