I am using latest version PrimeNG table for listing records in Angular 4. But I am facing issue with editing the record through p-drowpdown
. If I am selecting any of the data from the dropdown then its value field is displaying in column, which should be label field instead.
<p-column field="id" header="Name" [sortable]="false" resizableColumns="true"
[filter]="true" filterPlaceholder="Search" [editable]="true" [style]="{'overflow':'visible'}">
<ng-template let-col let-data="rowData" pTemplate="editor">
<p-dropdown [(ngModel)]="data[col.field]" [autoWidth]="false" required="true" [options]="attributeOptionList" class="form-control" [style]="{'width':'100%','height':'32px'}"
filter="filter" placeholder="Select Attribute"></p-dropdown>
</ng-template>
</p-column>
Example: Dropdown Example
value | label
1 | Newyork
2 | Auli
On the selection of city id 1, Newyork (label) should be displayed there, not its value. Currently its displaying 1 instead of Newyork