Skip to content

Instantly share code, notes, and snippets.

@apanzerj
Created June 13, 2012 13:42
Show Gist options
  • Save apanzerj/2924143 to your computer and use it in GitHub Desktop.
Save apanzerj/2924143 to your computer and use it in GitHub Desktop.
Row Coloration Based on Custom Field
$j(document).ready(function(){
$j('.linked > td.<custom field id>').each(function(){
if($j(this).text() == "high"){
$j(this).parent().css('background-color', '#E89090');
$j(this).html('<img src="https://github.com/apanzerj/images/raw/master/flag_mark_red.png" width="10" height="10">');
}
if($j(this).text() == "medium"){
$j(this).parent().css('background-color', '#E8E890');
$j(this).html('<img src="https://github.com/apanzerj/images/raw/master/flag_mark_yellow.png" width="10" height="10">');
}
if($j(this).text() == "low"){
$j(this).parent().css('background-color', '#90E8A2');
$j(this).html('<img src="https://github.com/apanzerj/images/raw/master/flag_mark_green.png" width="10" height="10">');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment