Need to apply background color to p-dropdown list dynamically
-
- Posts: 5
- Joined: 03 Dec 2018, 14:40
Need to apply background color to p-dropdown list dynamically
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Dropdown component has panelStyleClass you can utilize, for example creating two styles;
Then;
Code: Select all
.mypanel1.ui-dropdown-panel {
background-color: blue
}
.mypanel2.ui-dropdown-panel {
background-color: blue
}
Code: Select all
<p-dropdown [panelStyleClass]="condition ? mypanel1 : mypanel2"
-
- Posts: 5
- Joined: 03 Dec 2018, 14:40
panel style is applicable for Overlay panel right not for the dropdown. I want to apply the background color for dropdown list.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Not sure what you mean, there is also styleClass for the p-dropdown.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 10 guests