Home › Forums › General discussion › Color Coding multichoice selections
- This topic has 3 replies, 2 voices, and was last updated 3 years ago by Alexander Bautz.
-
AuthorPosts
-
-
September 21, 2021 at 23:20 #34529
In a DFFS form i have a list of multi-choice items displayed using check boxes. These items are milestones for projects underway. There are 5 different responsible parties for the group of milestones.
I am trying to find a way to designate ownership by the responsible groups
My thought was to change the font color for each item in the multichoice list to correspond with each role, but haven’t been able to get that to work. Is that possible? option 1, i used highlightinjg instead of font color to see easier
if color coding isnt an option, any other way to designate or group the selections in the view? maybe space the items in the dropdown to align with roles. (option 2)
Attachments:
-
September 22, 2021 at 15:00 #34534
You can try something like this in your custom js:
jQuery("#dffs_ChoiceColumnName .ms-RadioText").each(function(i, chk){ var color = "white"; switch(i){ case 0: color = "yellow"; break; case 1: color = "green"; break; case 2: color = "lightBlue"; break; } jQuery(chk).css("background-color", color); });
Replace ChoiceColumnName with the name of your choice column and adjust the index in each case to match the index of your choice.
Alexander
-
September 22, 2021 at 23:16 #34553
excellent, thank you that worked
quick followup, i used the below code. the “text = “milestone name”” ddint appear to do anything, the coloring was based on the order of the list, and case #s. Is that the right way to do it? or should i have adjusted the code to look for the specific text
`jQuery(“#dffs_Pipeline .ms-RadioText”).each(function(i, chk){
var color = “dark grey”;
switch(i){
case 0:
text = “Preliminary sizing of business benefit”
color = “#C65911”;
break;
case 1:
text = “Ideation”
color = “#C65911”;
break;
case 2:
text = “Data team capacity assigned”
color = “#00B050”;
break;
case :
text = “Data source identification”
color = “#00339A”;
break;
}
jQuery(chk).css(“color”, color);});
-
September 23, 2021 at 18:28 #34565
This code is designed to just use the index (number from top) of the checkbox and not the text to identify it. I’m not sure exactly what you meant to do with the text, but if you wanted it as a mouseover you can change this line:
jQuery(chk).css("color", color);
to this:
jQuery(chk).css("color", color).attr("title", text);
Alexander
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.