I would like to change color value in a browse form as following :
High Priority --> cell should be red
Medium Priority --> cell should be orange
Low Priority --> celle should be green
Those values are in the first column.
This javascript behind the custom form doesn't work :
Code: Select all
$(document).ready(function() {
// Loop through each row in the browse view
$('.nuBrowseCell').each(function() {
// Get the cell's text or value
let cellValue = $(this).text().trim();
// Apply conditional formatting
if (cellValue === 'High Priority') {
$(this).css('background-color', 'red'); // Change cell color to red
$(this).css('color', 'white'); // Change text color to white
} else if (cellValue === 'Medium Priority') {
$(this).css('background-color', 'orange');
} else if (cellValue === 'Low Priority') {
$(this).css('background-color', 'green');
}
});
});
Thx
Yves