Page 1 of 1

Row highlighting based on field value

Posted: 2021-06-13 13:07
by bwalker
Hello group, I am new to AppGini and I am having difficulty getting this feature to work and could use some assistance please.

Inspected my element, class name of the table field is 'Account-Type'

Duplicated the script in the 'footer-extras.php' file in the 'hooks' folder of the Northwind Demo project yet when I refresh (clearing cache) it doesn't work. Any Ideas?:

<script>
$j(function(){
$j('.Account-Type').each(function(){
var TType = $j(this).text();
if(TType == 'Credit'){
$j(this).parents('tr').addclass('success');
}
})
})
</script>

Any help is appreciated,
Thanks for your time.
Bill

Re: Row highlighting based on field value

Posted: 2021-06-13 14:51
by bwalker
The YT video demonstrates what I am trying to achieve and how:
https://youtu.be/DObUK-I-U8o

Re: Row highlighting based on field value

Posted: 2021-06-14 01:22
by Alisson
You wrote:
Inspected my element, class name of the table field is 'Account-Type'
But in the picture you posted the table name is
Acounting
not
Account
.

Re: Row highlighting based on field value

Posted: 2021-06-14 03:28
by bwalker
Thanks for the reply Alisson,
That is just the display name. The table name is Account.
Viewing the Console it says something about .addclass not being a valid function.
Again thanks

Re: Row highlighting based on field value

Posted: 2021-06-14 05:17
by bwalker
OK, I found it. I googled '.addclass not a function'
Answer: the 'c' in addclass needs to be capitalized.
I spent a day and a half on this.
Works fine now.
Thanks