Questions tagged [p-dropdown]
18 questions
4
votes
2 answers
PrimeNG dropdown needs doubleclick when using a function for options
I am using the PrimeNG dropdown with the PrimeNG turbo table. I have column that uses the dropdown in edit mode where I need the options to be filtered based on the value of another column. Then I have the issue described here.
I can't really find a…

danskov
- 113
- 1
- 13
2
votes
1 answer
primeNG: 13.4.0 p-dropdown set default value
I am creating a webpage with PrimeNG: 13.4.0 and Angular: 13.3.6. I have a dropdown in a p-table grid that should display a Country Of Origin. When I open the row for edit, the p-dropdown does not display the importLine.countryOfOrigin value. This…

OhioPrimeNGDev
- 71
- 3
1
vote
1 answer
Change the colour of p-dropdown items based on a Boolean value
I want to change the background colour of my primeng drop-down items which is dependent on a boolean value that I'm getting from an api and pushing it into a array i.e users
I have a array of objects users which contains 3 fields.
Response of the…

Dips28
- 13
- 3
1
vote
0 answers
Add an "All" option to PrimeNG Dropdown
I'm trying to display data based on value selected in a dropdown. I need help adding an "All" option to the PrimeNG dropdown. The dropdown takes data from a json array of objects, and displays data corresponding to the object…

twentyseen
- 11
- 2
1
vote
2 answers
PrimeNG dropdown does not select value when loaded twice in component
I have a simple data model where a study has many samples. I set the p-dropdown's options, ngModel, and optionLabel during the ngOnInit method of the control:

Josh
- 10,352
- 12
- 58
- 109
0
votes
1 answer
Replacing the [options] inside a p-dropdown
In my angular project, I have a homepage containing a datatable and a filter.
homePage.component.ts defines the filter structure as a list of filter options, as such:
this.filterOptions = [
[...]
{
name: 'verificationMethod',
…

rekotc
- 595
- 1
- 10
- 21
0
votes
2 answers
Focused Dropdown Disable Selection via Keyboard
Is there a way to disable the keyboard support for printable characters, mainly letters?
I want to suppress, that an option gets selected when typing any letter.
I tried something like this, but the problem is, that i have a directive bound to a…

neukoellnjenny
- 35
- 6
0
votes
0 answers
Angular p-drowdown view list when editable without having to click down arrow or enter key
I have an p-dropdown control on my page.

Ebrahim Allie
- 1
- 2
0
votes
1 answer
How to solve this anti-pattern: calling method in template
I am using a p-dropdown from PrimeNG and i have to display the updated values.
At the moment in my HTML in the p-dropdown i typed this:
[options]="getReportTypes()"
In my typescript I have this situation:
reports: ReportTemplateGroupList |…

Unearthly
- 121
- 6
0
votes
2 answers
With PrimeNG and Angular 14, how do I change my CSS class based on whether there is an error on my p-dropdown component?
I'm using PrimeNG and Angular 14. I would like to apply a class (a red border) to my p-dropdown component if the form control contains errors and set another class if it doesn't contain errors. I tried this

Dave
- 15,639
- 133
- 442
- 830
0
votes
1 answer
Angular - Value binding issue while using ng-template and ngTemplateOutlet
I created a live example on Stackblitz with dropdown from primeng.
My issue is that whenever I change the value from the dropdown without ng-template it works fine and all dropdowns are modified, but if I change the value from a dropdown which is…

manjiro sano
- 784
- 3
- 15
0
votes
2 answers
How can I preset a value by default in p-dropdown?
I am trying to preset a default value in the below p-dropdown.
[ item.component.html ]
{{…

JBC
- 33
- 5
0
votes
1 answer
How to set up a default value in p-dropdown?
The p-dropdown below is reading json data from API. Among the data values, I want to set up "apple" by default. Currently, in the p-dropdown, the first thing users can see is the placeholder value (i.e "Select a Product").
How can I preset a default…

JBC
- 33
- 5
0
votes
1 answer
Disable certain ng-template items in p-dropdown
I have a p-dropdown contructed with ng-template (this dropdown presents Languages that can be selected.) I need the languages that have been already selected, to be disabled.
This is my dropdown:

Katia S.
- 197
- 2
- 13
-1
votes
1 answer
How can I pass the selected value from p-dropdown to ts?
This is an example of code for p-dropdown.
// product.component.html
This is json data I am getting from API. In the p-dropdown,…

JBC
- 33
- 5