p-dropdown: option to always display options above?

UI Components for Angular
Post Reply
pmilkman
Posts: 1
Joined: 24 Mar 2016, 22:44

19 Apr 2018, 20:47

We have a layout where we'd like to force the options for a p-dropdown to always display above the control.

I've looked through the docs, Google and some of the source code and didn't see any existing way to do this. Have I missed the option? Or is there a way to hack it in there?

Thanks!

appedology
Posts: 1
Joined: 20 Apr 2018, 06:19

20 Apr 2018, 06:32

Maybe (similar to tooltips) it would be good to have an optional "where" option which defaults to down, but could be overridden?

EmilyWilliamson
Posts: 1
Joined: 13 Sep 2019, 07:06
Contact:

13 Sep 2019, 07:52

You can set default value of PrimeNG Dropdown by using ngModel as shown on the following approach:

component.html:

Code: Select all

<p-dropdown [options]="cities" name="selectedCity" [(ngModel)]="selectedCity"></p-dropdown>
component.ts:

Code: Select all

selectedCity: string = 1; //Id value of the City to be selected
If failed then use below code

Code: Select all

this.cities.value = this.selectedCity;

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests