Complete solution for conditionally coloring the cell of a table

Complete solution for conditionally coloring the cell of a table

  
There has been dialog on this in the past, but no complete solutions.   Can anyone post a simple, non-javascript solution
for conditionally coloring a cell of a table?    Thank you.
Frank -

This is pretty easy, actually!

In the cell (or the row, for that matter), if you select it you will see that there are "Extended Properties", which can be bound to variables. One of the built-in extended properties is "style" (you can also type property names in if needed). Just bind the style property to a variable and edit the variable's value at run time as needed. You can even have it respond to user input via AJAX. If you have trouble figuring it out, let me know, and I can whip up a quick demo for you, and do a screen share while I do it to walk you through it.

J.Ja
Justin - thanks much.   I'll take you up on an example.   I just want to be able to examine the cell of a table, and, say, color it red if the text is "Fail" and color
it green if the text is "Pass".   Something I do in my ASP.NET apps all the time.
Hi Frank,

No wanting to cut into your conversation, you may try to use the IF widget, and depending on the result of evaluating the condition, it will display one thing or the other.

In your case, unless you explicitelly want to set the red background on the table cell - TD - element, I would have a Div Container in each branch of the IF widget, one with the Red background style, and the other with the green background style.

Would this solve your problem?

Regards,

Paulo Tavares
Paulo -

That's a great way to do it too.

Frank, do you want to do this on a screen share? If so, email me at justinjames [at] titaniumcrowbar.com and we'll arrange a time, or just call me at 803-760-7127 (I'll be around for most of this afternoon from 2 PM on).

J.Ja
Paulo - in that case, the IF widget is placef where - around the text item in the cell?
Justin - thanks so much for the offer.   I'm at work today, unable to call, but if I fail at it myself tonight, I'll find some slot to do that with you.   Thank you.
Frank -

Yes, but the If widget inside the cell, but around the Container and the Container goes around the text.

I can be available this evening too, if you want. I am on "vacation" which means I'm working away on personal projects, and I work from home anyways...

J.Ja
Hi Frank and Justin,

I see Justin already replied while I was trying to create a small example for you. I took this screenshot of a similar thing - only with icons instead of the Green/Red containers.



Good luck with it, and let us know how it went!

Regards,

Paulo Tavares