597
Views
8
Comments
Solved
specific color for only particular items in the list dropdown

Hi ,

I would like to change the color of the specific items in the list dropdown like as shown in the attached image file.I'm able to get it by css for the first three child elements in the list using CSS. but when i search particular element the other first three suggested elements also changing the color. I want the color only for those items. Please suggest me how can i achieve this.


 

Thanks in advance,

Ekadeep K


UserImage.jpg
Milton Sagala
Solution

Kuruma Ekadeep wrote:

Milton Sagala wrote:

Please see attached sample oml. I added a event during searching to add the color again.

Hi Milton Sagala,

I tried with the logic that present in the oml that you provided. Appreciate you on providing that code. But when i create similar drop down having special list values it is not working as epected, it loosing it property when during the time of search. Please refer the sample oml. and link

http://tmai-dev-dev.outsystemscloud.com/sample/Entry1.aspx?_ts=637091584759183926 


Looking forward to hear from you.


Thanks in advance,

Ekadeep



I tried to recreate the data and made some minor changes to your code. Please see attached oml.


https://miltonjohnsagala.outsystemscloud.com/sample/Entry1.aspx?_ts=637092243032393192


Thanks.


sampleupdated.oml
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Kuruma,

What kind of app are you creating, Web, Reactive Web or Mobile? And what Dropdown Widget are you using? The one from OutSystems UI?

2023-12-31 10-08-37
Ekadeep K

Kilian Hekhuis wrote:

Hi Kuruma,

What kind of app are you creating, Web, Reactive Web or Mobile? And what Dropdown Widget are you using? The one from OutSystems UI?


I'm creating web app and i used combo box along with dropdownselect widgets . 


Suggest me how can i achieve that type .

UserImage.jpg
Milton Sagala

A workaround for this is to use javascript to apply style/class to the label of the list wherein the input value is the text of the first 3 child element.

2023-12-31 10-08-37
Ekadeep K

Milton Sagala wrote:

A workaround for this is to use javascript to apply style/class to the label of the list wherein the input value is the text of the first 3 child element.

I tried with that too, it is working but whever the user use search input it loosing its property

$(document).ready(function(){
  $("#wt3_OutSystemsUIWeb_wt2_block_wtContent_wtMainContent_wtselectcontainer").click(function(){
   $("#choices-wt3_OutSystemsUIWeb_wt2_block_wtContent_wtMainContent_wtselect-item-choice-1").css("color", "red");
   $("#choices-wt3_OutSystemsUIWeb_wt2_block_wtContent_wtMainContent_wtselect-item-choice-2").css("color", "yellow");
   $("#choices-wt3_OutSystemsUIWeb_wt2_block_wtContent_wtMainContent_wtselect-item-choice-3").css("color", "blue");
  });
});


UserImage.jpg
Milton Sagala

You can try something like this:


SyntaxEditor Code Snippet

$(document).ready(function(){
  $("input[value='Manage Plan']").parent().css({"color": "red"});
});
UserImage.jpg
Milton Sagala

Please see attached sample oml. I added a event during searching to add the color again.

sample.oml
2023-12-31 10-08-37
Ekadeep K

Milton Sagala wrote:

Please see attached sample oml. I added a event during searching to add the color again.

Hi Milton Sagala,

I tried with the logic that present in the oml that you provided. Appreciate you on providing that code. But when i create similar drop down having special list values it is not working as epected, it loosing it property when during the time of search. Please refer the sample oml. and link

http://tmai-dev-dev.outsystemscloud.com/sample/Entry1.aspx?_ts=637091584759183926 


Looking forward to hear from you.


Thanks in advance,

Ekadeep



sample.oml
UserImage.jpg
Milton Sagala
Solution

Kuruma Ekadeep wrote:

Milton Sagala wrote:

Please see attached sample oml. I added a event during searching to add the color again.

Hi Milton Sagala,

I tried with the logic that present in the oml that you provided. Appreciate you on providing that code. But when i create similar drop down having special list values it is not working as epected, it loosing it property when during the time of search. Please refer the sample oml. and link

http://tmai-dev-dev.outsystemscloud.com/sample/Entry1.aspx?_ts=637091584759183926 


Looking forward to hear from you.


Thanks in advance,

Ekadeep



I tried to recreate the data and made some minor changes to your code. Please see attached oml.


https://miltonjohnsagala.outsystemscloud.com/sample/Entry1.aspx?_ts=637092243032393192


Thanks.


sampleupdated.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.