God Morning everybody,
my name is Mauro and i'm new members.
For my company i have going to create a system for production schedule.
Now I have little problem.
in my CCV5 there is a conditions in the model->conditions and it'is OK, i have in modules-->fields a function sum(qta) and it's ok.
I want color the rows of the table where this sum(qta) is >40.
You can Help me?
Thanks
my name is Mauro and i'm new members.
For my company i have going to create a system for production schedule.
Now I have little problem.
in my CCV5 there is a conditions in the model->conditions and it'is OK, i have in modules-->fields a function sum(qta) and it's ok.
I want color the rows of the table where this sum(qta) is >40.
You can Help me?
Thanks
Hi Mauro,
If you use the Display Type > Custom for your listing then you can add code to the List Display > Body Code ox to check the value of the sum and set a class for the <tr> element that you can then color with CSS.
Bob
If you use the Display Type > Custom for your listing then you can add code to the List Display > Body Code ox to check the value of the sum and set a class for the <tr> element that you can then color with CSS.
Bob
hallo GreyHead, thanks for your quick response.
I've tried to write a php code in
front list -> list display -> custom -> body code but i think that I did not understand how it works as.
i tried write for example
<?php echo('pippo') ?> but I do not go blank.
excuse my ignorance, but could not find specifics on what to write in this field...
I've tried to write a php code in
front list -> list display -> custom -> body code but i think that I did not understand how it works as.
i tried write for example
<?php echo('pippo') ?> but I do not go blank.
excuse my ignorance, but could not find specifics on what to write in this field...
Hi miosito,
Have you set the Display Type to Custom on the Front List > Settings tab?
Bob
Have you set the Display Type to Custom on the Front List > Settings tab?
Bob
hi Bob,
i'm very stupid...i have not chage value custom in setting tab...
ok..now custom work...but i must rewrite all the code to create all the table?
i'm very stupid...i have not chage value custom in setting tab...
ok..now custom work...but i must rewrite all the code to create all the table?
Hi mlosito,
If you want to use that method - then yes. It might be possible to use JavaScript to check the values and apply the styling using the Table layout if that is simpler. I've never tried that but I think it should work.
Bob
If you want to use that method - then yes. It might be possible to use JavaScript to check the values and apply the styling using the Table layout if that is simpler. I've never tried that but I think it should work.
Bob
ok Bob,
last questions
if i want use javascript where i must write the code? I must use a particolar type of code?
last questions
if i want use javascript where i must write the code? I must use a particolar type of code?
Hi Mauro,
Under "Front list" > "List display" > "Table" "header code", there is a box where you can add javascript code with tags.
Best regards,
Max
Under "Front list" > "List display" > "Table" "header code", there is a box where you can add javascript code with tags.
Best regards,
Max
.....ops..
i tried bat it is not simple...i think that is not possible use only javascript function in the header because i must change color of row only if a determinate field in the row il >40 for example.
you have idea?
another questions..
how to use "PHP function" and "HTML" in the front list setting? they can resolve the problem?
Thanks.... I think that I buy the manual when it becomes available
i tried bat it is not simple...i think that is not possible use only javascript function in the header because i must change color of row only if a determinate field in the row il >40 for example.
you have idea?
another questions..
how to use "PHP function" and "HTML" in the front list setting? they can resolve the problem?
Thanks.... I think that I buy the manual when it becomes available
Hi Mauro,
You can use the value in the class attribute and use that as a selector for even css, if you have a custom list then in the body box:
And you can then use css:
You use php functions and other features as normal, they help if you have "Table" listing, but in custom listing you can do anything.
Best regards,
Max
You can use the value in the class attribute and use that as a selector for even css, if you have a custom list then in the body box:
<li class="value_{valuefield}">some data here</li>
And you can then use css:
li.value_40{color:red;}
You use php functions and other features as normal, they help if you have "Table" listing, but in custom listing you can do anything.
Best regards,
Max
Hi Mauro,
I experimented with this and was able to do something similar using JavaScript in the Header box.
I think that this can be adapted to do what you need.
Bob
I experimented with this and was able to do something similar using JavaScript in the Header box.
<?php
$jdoc = \JFactory::getDocument();
$script = "
jQuery(document).ready(function(jQ){
jQ('td[class$=id]').each( function() {
var id = jQ(this).html();
if (parseInt(id) > 3 ) {
jQ(this).css('border', '1px solid blue');
}
})
});
";
$jdoc->addScriptDeclaration($script);
?>
The code here checks for <td> elements with classes ending in id (CC adds classes like td-content.id that you can use) and, if the entry in the <td>. element is greater than 3 it adds a blue border to the cell.
I think that this can be adapted to do what you need.
Bob
This topic is locked and no more replies can be posted.