[SOLVED] Custom_css and calc element

maxinic

Member
Hy everyone
I have a simple calc element (use as a row class):

$abrogata = ('{ordinarie___abrogata}');
if ($abrogata = 1)
{ return 'colrosso'; };

Where ('{ordinarie___abrogata}') is a yes/no element.

This is my custom_css.php
#listform_$c {
margin-top: 25px !important;
}
#listform_$c tr.colred td.ripiegamenti___data_ripiegamento {color:red;};
#listform_$c tr.ordinarie.colrosso td.ordinarie__TITOLO {color:red;};

Unfortunately nothing change on my rows. Any tips for me?


 
Try:

$abrogata = '{ordinarie___abrogata_raw}';
if ($abrogata == 1)
{ return 'colrosso'; }

And also remove semicolons after the closing brackets in custom_css.php, that means } instead of };

And make sure with browser inspect function that the class which "mark as row class" function adds, is the one that you have in custom_css.php
 
Try:

$abrogata = '{ordinarie___abrogata_raw}';
if ($abrogata == 1)
{ return 'colrosso'; }

And also remove semicolons after the closing brackets in custom_css.php, that means } instead of };

And make sure with browser inspect function that the class which "mark as row class" function adds, is the one that you have in custom_css.php

Thanks for the reply juuser but i think that the problem is in Custom_css.php because calc element works well
upload_2021-4-22_9-50-19.png
could it be that by returning a number (1) I have to add something?
 
You have to check the right class name with browser inspect function. For the element called "myelement", added class is something like "myelement_1" when elements value is "1".
 
in fact the custom_css is not applied
how can you see:

upload_2021-4-22_10-42-36.png

however my class name should be colrosso not a number
I'm confused :)
 
Check in your browser console if the class is added to the tr (not td), if your CSS "source" is loaded correctly etc.
 
This is from my browser

upload_2021-4-22_11-51-15.png
 

Attachments

  • upload_2021-4-22_11-48-14.png
    upload_2021-4-22_11-48-14.png
    51.3 KB · Views: 76
  • upload_2021-4-22_11-49-48.png
    upload_2021-4-22_11-49-48.png
    28.5 KB · Views: 66
So colrosso is correctly added.

Check in the browser if your custom_css.php is loaded correctly (you may have a typo breaking the CSS...), you should get something like this
upload_2021-4-22_12-35-14.png
 
I just found that it seems you have/had a missing _ in your CSS
#listform_$c tr.ordinarie.colrosso td.ordinarie__TITOLO {color:red;}; it must be 3_
#listform_$c tr.ordinarie.colrosso td.ordinarie___TITOLO
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top