style for selection | Community
Skip to main content
New Participant
October 16, 2015
Solved

style for selection

  • October 16, 2015
  • 12 replies
  • 1531 views

Hi,

Is there a way to set a style on each item of a selection component?

[img]style.png[/img]

The properties style, labelStyle and bodyStyle don't work.

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by edubey

yes, you can use 'cls' property, but the it won't add styles on drop down. This class will be added to the parent div of it. So you need to target that particular drop down div.

12 replies

edubey
New Participant
October 16, 2015
Correct me if I am wrong....you want to apply color to the drop down items in style. Its possible , but then you have override the default behavior and apply your custom behavior in richtext files....       
edubey
New Participant
October 16, 2015
Thanks for clearing.... #CQ x-combo-list-item {color:red !important;} Place above css in you client lib which gets loaded in edit mode      
Lokesh_Shivalingaiah
New Participant
October 16, 2015

It should work, you can highlight the text you want and select the style so that it applies the style only for the selected content.

New Participant
October 16, 2015

Hi, thanks for the replies

it's just coincidence that under the selection there is a richtext. The style selection isn't the style plugin of richtext, it's a simple selection component.

I want to replicate the same approach of the style plugin of richtext with another selection component.

New Participant
October 16, 2015

Doesn't exist the possibility to add the style as property?

edubey
New Participant
October 16, 2015

I understand the behavior od Styles drop down in RTE,

Now when you say, "you want to replicate this behaviour" what do you exactly mean. Are you planning to add one more drop down in richtext like styles?

Lokesh_Shivalingaiah
New Participant
October 16, 2015

Can you provide the usecase in detail or the steps you want to do so that we can address this better.

edubey
edubeyAccepted solution
New Participant
October 16, 2015

yes, you can use 'cls' property, but the it won't add styles on drop down. This class will be added to the parent div of it. So you need to target that particular drop down div.

New Participant
October 16, 2015

Well =) , richtext has nothing to do to my problem and you can ignore the word style. I have a selection component with 3 entries. For example i need to color the first entry to red. It's only this my problem.

New Participant
October 16, 2015

Well i think that first element blue, second green and third red will be a nightmare =)