Page 1 of 1

How to change the color of a field

Posted: 2019-10-22 22:55
by Moh Youba
Hello

I am using AppGini 5.81. I have a table with price field. I want to color the field with minimum price.

Any help please.

Thank you

Re: How to change the color of a field

Posted: 2019-10-23 08:21
by onoehring
Hi,
I would suggest using /hooks/tablename-tv.php. Create a JS/jquery function which checks all prices and adds a CSS class to the minimum value.

I am using this to add a color (css class) to the complete row according to the value in the column ID_posZ - maybe it helps.

Code: Select all

$j(function () {
	$j('.tablename_container-ID_posZ').each(function(){ 
		var ebene = $j(this).text();
		
		var new_CSS_basename = "ebene_";
		var new_CSS_class = new_CSS_basename.concat(ebene);
		
		$j(this).parents('tr').addClass(new_CSS_class);
	})
});
Olaf

Re: How to change the color of a field

Posted: 2019-10-23 12:52
by Moh Youba
Hello

Thank you for your help, I will try add this and see.

Best regards,

Re: How to change the color of a field

Posted: 2019-10-23 14:10
by onoehring
Hi Moh,

this will NOT work for you. It was meant to be an example of how to check for certain criterias (in all rows) of the table. You will need to write your own code - which you might be able to base on the code I provided.

Olaf

Re: How to change the color of a field

Posted: 2019-10-23 14:17
by Moh Youba
ok I see

ok, I will give a try

Thank you