I have pdropdown inside the grid i binded dropdown options based on function but issue what i am having is options is being selected when i double click on option. Can anyone please suggest some suggestions.
.html code
-----------------------------------------------------------
<p-dropdown
placeholder="(select one)"
[options]="newUserTypeDetails(record)"
(onChange)="onUserTypeChange($event)"
[(ngModel)]="record.newUserType"
>
</p-dropdown>
.ts code
-------------------------------------------------------------------------------
newUserTypeDetails(record: UserDetailsForSummaryDemographics) {
let options = []
switch (record.userType.toLowerCase()) {
case 'r':
options = this.usertypes.filter(x =>
x.code == 'FE' || x.code == 'A' || x.code == 'CR' || x.code == 'NS' || x.code == 'OT'
).map(o => ({ 'value': o.code, 'label': o.name }));
break;
case 'fe':
options = this.usertypes.filter(x =>
x.code == 'A' || x.code == 'OT'
).map(o => ({ 'value': o.code, 'label': o.name }));
break;
case 'ms':
options = this.usertypes.filter(x =>
x.code == 'R' || x.code == 'NS' || x.code == 'OT'
).map(o => ({ 'value': o.code, 'label': o.name }));
break;
case 'cr':
options = this.usertypes.filter(x =>
x.code == 'FE' || x.code == 'NS' || x.code == 'A'
).map(o => ({ 'value': o.code, 'label': o.name }));
break;
default:
break;
}
options.unshift({ 'value': 'AR', 'label': 'Archive User' });
return options;
}
Dropdown options issue
-
- Information
-
Who is online
Users browsing this forum: No registered users and 16 guests