How to change the color of a field

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
Moh Youba
Veteran Member
Posts: 228
Joined: 2017-03-12 09:31

How to change the color of a field

Post by Moh Youba » 2019-10-22 22:55

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

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: How to change the color of a field

Post by onoehring » 2019-10-23 08:21

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

Moh Youba
Veteran Member
Posts: 228
Joined: 2017-03-12 09:31

Re: How to change the color of a field

Post by Moh Youba » 2019-10-23 12:52

Hello

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

Best regards,

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: How to change the color of a field

Post by onoehring » 2019-10-23 14:10

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

Moh Youba
Veteran Member
Posts: 228
Joined: 2017-03-12 09:31

Re: How to change the color of a field

Post by Moh Youba » 2019-10-23 14:17

ok I see

ok, I will give a try

Thank you

Post Reply