Change row or field css

Newbie here. I am working with an editable grid and a simple grid. What I would like to do is change the text-decoration css property of a row or field.

sc_field_style({My_Field}, “Background-Color”, “Size”, “Color”, “Family”, “Weight”) - Changes specific css properties but not others.

What I am trying to do is make a to-do list. When a row is marked complete, it gets crossed out. Still visible and editable, just crossed out.

Does anyone know if this is possible? Tech support said it wasn’t available, but sometimes veteran users know tricks.

Thanks.

Not without a lot of hassle. I would opt for a different approach: i.e. change the background to lightgray.

Not a reply but an addition to this post… ----- >> How do you change the background on a row? There is only an option to change the color on a field but not on a row… I am looking to display the entire row in a different background color controlled by an event and some condition… Does anyone know how to change the “BACKGROUND COLOR” on a row???.
Thanks

Did you ever figure this out? I asked tech support too and they didn’t have an answer. There must be a way with php to loop through the records and make changes to the fields and/or rows. Even if it is a pain, I would like to know that if I buy the product I can have this flexibility. Otherwise it is a difficult limitation to justify. It is tough to explain to a user why something simple can’t be done.

I haven’t tried it, but I think you could use a custom template for the grid. Something like this (modified from the example in the manual)

<table border=“0” cellspacing=“0” cellpadding=“0”>
<tr class="{strikeornot}">
<td width=“247” height=“96” align=“left” valign=“center”>
<font face=“verdana” style=“font-size:11px”>
<b>{Name}</b><br>{Address}<br>{City}- {State}<br>
{ZIP}
</font>
</td>
</tr>
</table>

and then in the onRecord event set {strikeornot}=“done”; or {strikeornot}=“notdone”

and then create a CSS class to style it the way you want.

This is still pretty complicated. And as I said, I have not tried it yet. but this would be the way I’d go after it at least for now.

Hello,

I want to do something similar.
If you find a way to change the complete row style, please comment here.

Thanks

I am checking back in with scriptcase. I am wondering if anyone knows if the original question is solvable in the newest version?

has the sc_field_style macro been expanded to include more styles? Or has a new method been added.

I didn’t see anything in the documentation, but I am not an expert so I don’t know if I am looking in the correct area.

In a grid onRecord event:

if ({status} == 1) {echo “<style>#id_sc_field_yourfieldname_” . $this->SC_seq_page . " {text-decoration:line-through; }</style>"; }

jsb

jsbinca - you are a life-saver once again. I’ve been trying to figure out the CSS of fields outside of the “sc_field_style” macro parameters so I can add an underline to an email field. Your solution worked well except when the grid was sorted by one of the columns - a message box appeared and after closing it, the underlines disappeared. BUT, from your post I figured I could style all email fields the same way using the field class which I determined by checking Firebug. I then put the following in Events > OnApplicationInit:

echo “<style>.css_email_grid_line {text-decoration:underline; }</style>”;

That styled all the email links with the underline and sorting made no difference/issue.

Thanks for your input - it led me to a solution.

1 Like