colour formatting fields in vlookup table
- This topic has 2 replies, 2 voices, and was last updated 5 years ago by .
Viewing 2 reply threads
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Home › Forums › Classic DFFS › colour formatting fields in vlookup table
Hi,
Is it possible to change the background colour of a field in a vLookup list on a parent form based on it content i.e. red background if the value is “No” and Green if “Yes”?
I know you can give some “Special configurations” code to the field in the vLookup config but I don’t know if you can include If/Then statements?
Cheers,
Phil
You can add this to your custom js:
function vLookupIsLoadedCallback(fin) {
if (fin === "vLookupTasks") {
jQuery("#dffs_vLookupTasks").find(".vLookupTasks_Status").each(function(i, td){
if(jQuery(td).text() === "New"){
jQuery(td).css({"background-color": "red", "color": "white"});
}
});
}
}
Replace vLookupTasks_Status with the internal name of your vLookup field in combination with the internal name of the field from the child list (right click and inspect the cell in your vLookup table to see the class attribute for the correct name) and then replace the two remaining vLookupTasks with the internal name of your vLookup field.
Alexander
Works a treat, thanks for the quick reply.