Questions tagged primeng-dropdowns

Explore the latest questions and answers asked by our top developers.

p-dropdown ‘required’ property is not setting ‘required’ attribute to its input element (primeng 11)

After using some time primeng components I noticed that the component ‘p-dropdown’ is not adding the ‘required’ attribute to the original input which is inside a div with the class ‘p-hidden-accessible’. In contrast to the other components such as ‘p-autocomplete’ that is indeed setting the ‘required’ attribute to its inside input element. Here are some […]

By Daniel Cruz
Categorized as angular, primeng, primeng-dropdowns Tagged , ,

Typescript strict mode cannot assign Observable async to primeNg dropdown component

I am using the p-dropdown primeNg component and from what I can see this should be able to take an Observable | async value and use it properly but the Typescript strict mode will not allow this, giving error TS2322: Type ‘Customers[] | null is not assignable to type ‘any[]’" customers.html <p-dropdown [options]="customers$ | async" […]

How to set value PrimeNG p-dropdown with a value read from the server?

I receive the value of myModel.field correctly from a server (for example myModel.field = "id2"), but it is not selected in the p-dropdown, what should I do? This is my options (the dropdown populates fine): options = [ { label: ‘Opt1’, value: ‘id1’ }, { label: ‘Opt2’, value: ‘id2’ }, { label: ‘Opt3’, value: ‘id3’ […]

By doinel
Categorized as angular, primeng, primeng-dropdowns Tagged , ,

PrimeNg (7.x) p-dropdown boolean value

I have like to have a p-dropdown which contains two options.. But it does not selected base on the control boolean value. The control (NOTIF_ALL) receive a boolean value oldPendingTasksOptions=[ {"oldPendingTaskId": false, "oldPendingTasksName": "Not activated", "version": 1}, {"oldPendingTaskId": true, "oldPendingTasksName": "Activated", "version": 1} ] <p-dropdown [options]="oldPendingTasksOptions" [showClear]="true" placeholder="Select an option" optionLabel="oldPendingTasksName" formControlName="NOTIF_ALL"></p-dropdown> Source: Angular Questions

By Jean-Philippe M
Categorized as angular, primeng, primeng-dropdowns Tagged , ,

How to click to the selected item then navigate to the corresponding component in p-dropdown?

Please see the p-dropdown I modified the class City which now has one more property url. This property indicates the path of a component. I have created the dropdown as interface City { name: string; code: string; url: string; } export class DropdownDemo { cities: City[]; selectedCity: City; constructor() { this.cities = [ {name: ‘New […]

By Hello
Categorized as angular, primeng, primeng-dropdowns Tagged , ,

How to bind data of multiselect dropdown of primeng Angular

I am using primeng Multiselect dropdown in a form. While clicking on the edit button I want to display the existed data in all the field. for Input text it is displaying as I am using [(ngModel)] and I have tried the same for Multiselect dropdown as well but it is not working. so I […]

By Akanksha Mohanty
Categorized as angular, primeng, primeng-dropdowns Tagged , ,

Angular 9 PrimeNG p-dropdown selected value

I have a list of objects that can be expanded and edited, with a couple of drop-downs that are populated once you expand. Each row is an object of the type Gama: { IdMaterial: 2,IdProveedor: 2, ..other props } on onRowExpand, i populate a dropdown inside the expanded form, like so: onRowExpand(event){ this.gamaService.getMaterialesPorProveedor( => this.materialesPP […]

By Arnau
Categorized as angular, primeng, primeng-dropdowns Tagged , ,

PrimeNG dropdown with image

I am trying to implement PrimeNG’s dropdown with images in front of option label, but the images are not displayed. In the .ts file I have the options array like: langOptions = [ {label: ‘hungarian’, value: ‘hu’, imgSrc: ‘./assets/img/flags/flag_hu.svg’}, {label: ‘english’, value: ‘en’, imgSrc: ‘./assets/img/flags/flag_en.svg’} ]; in the template: <form [formGroup]="langChangeForm"> <p-dropdown [options]="langOptions" optionLabel="label" (change)="onChange($"> […]

By szelelaci
Categorized as angular, primeng, primeng-dropdowns Tagged , ,

PrimgNG + Angular Required field Validator for dropdown

I’m using a PrimeNG dropdown component and need to trigger a required field validation. when I click on form submit browser level validations is showing only error message. but I want dropdown + error message to be displayed. this behavior is only in p-dropdown it’s working fine for other primeng components. this is the behavior […]

In primeng how can we get the default dropdown value filter for a column of a table

I’m reffering to this document, here for the status column how can we make it a default selected value and that default value related rows should only display Source: Angular Questions

1 2 3

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us