p-dropdown show method not working

UI Components for Angular
Post Reply
sunaung
Posts: 1
Joined: 31 Oct 2017, 01:08

28 Jul 2021, 02:52

Hello

I am trying to display dropdown options panel programmatically by calling show method of the p-dropdown but options panel is not displaying. When I called the show method, the "overlayVisible" variable is set to true but I cannot see the option panel open.

Code: Select all

 "primeflex": "^2.0.0",
 "primeicons": "^4.1.0",
 "primeng": "^11.4.4",
html

Code: Select all

<p-dropdown [options]="alertOptions" [(ngModel)]="alertValue" #alertType placeholder="Choose Alert Type"> </p-dropdown>

 <p-button type="button" label="Show Alert Options"  (onClick)="show()"> </p-button>
ts

Code: Select all

import { Dropdown } from 'primeng/dropdown';

@ViewChild('alertType') alertType: Dropdown;
  
show() {
  	this.alertType.show();
  }
What is the correct way to display dropdown option panel programmatically?

Thanks

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests