If you need the conditional formatting on the List View, then the traditional way in 2010 is to use a DataView in SharePoint designer. You could use a workflow to support this by doing the formula for you and assigning a value to a custom field to mark the color, but this can be accomplished in the DataView without it. A calculated field on the list item can probably accomplish the same thing a workflow calculation.
As the expert, which way would you do it?
I've done conditional formatting before. However, it was just based on another field's value not the calculation of two fields. And I didn't format the whole row just a single cell.
I'd upgrade to 2013 and use a display template!!
But in 2010, I probably would not use a workflow unless I couldn't get the value(condition) I needed for the DataView.
I didn't think of this at first, but even in 2010 you can use JQuery to change styles of elements. Review this if it is an option.
here is an example I found
$('input[type=checkbox]').change(function(){
if($(this).prop('checked')){
$(this).parent().css('backgroundColor', '#bff0a1');
}else{
$(this).parent().css('backgroundColor', '#eee');
}
});
This example shows that you can query for an element based on attributes and then change the selected element's styles.
Unless I'm missing something, I don't think this will work. This is based on a SharePoint date field subtracting the current date then formatting the color. Based on the results of the calculations it will then determine the color. This thing has been on my nerves for TWO days. I'm now ready to throw my PC across the room! To make things worse, SharePoint Designer shows different results than the browser does! Ughhh!
Hi Lisa,
Here is maybe and idea (please let me know more about what you need to do if I am way off here): Inside of your workflow perform the date calculation. Have another column that you can update with the color that you want this row to be as a result of your date calculation. For example: Column named "Color" specify "Red" then have whatever code you are using to change the row column color to be based on the color specified in this column.
Hopefully this helps?
Mike
Hey Mike,
Hmmmm....this is something to try. I'll take a look and let you know Mike. Thanks!
Lisa
I hope that didn't hold you up, I mentioned that on the 19th.
The jquery could perform the calculation for you and then set the color, or look for a color value in a field and then set the color it wouldn't matter. I believe both possibilities could be accomplished with a dataview webpart as well.
No problem, just trying to save one computer/monitor at a time.
No....I was so into working this darn thing I hadn't logged into the community for a few days.
I got this to work. I added a SharePoint column for the number of days. I did the calculation in Nintex and set the number of days field. In SharePoint Designer, I did the conditional formatting based on the number in the number of days! Simple! I don't know why SharePoint Designer had such a problem handling it. I had to deal with Ticks (what the heck) and all this other stuff when I tried calculating in Designer! Doing it this way was way easier.
Awesome, I was going to say you could do it exactly as you did it, rather than using color words, so great job!