Page 1 of 1

Need to apply background color to p-dropdown list dynamically

Posted: 05 Dec 2018, 15:03
by Lakshmi_984
Need to apply background color to p-dropdown list dynamically

Re: Need to apply background color to p-dropdown list dynamically

Posted: 06 Dec 2018, 11:05
by cagatay.civici
Dropdown component has panelStyleClass you can utilize, for example creating two styles;

Code: Select all

.mypanel1.ui-dropdown-panel {
    background-color: blue
}

.mypanel2.ui-dropdown-panel {
    background-color: blue
}
Then;

Code: Select all

<p-dropdown [panelStyleClass]="condition ? mypanel1 : mypanel2"

Re: Need to apply background color to p-dropdown list dynamically

Posted: 06 Dec 2018, 14:23
by Lakshmi_984
panel style is applicable for Overlay panel right not for the dropdown. I want to apply the background color for dropdown list.

Re: Need to apply background color to p-dropdown list dynamically

Posted: 23 Jan 2019, 09:26
by cagatay.civici
Not sure what you mean, there is also styleClass for the p-dropdown.