Row highlighting based on field value

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
bwalker
Posts: 13
Joined: 2021-05-24 22:30

Row highlighting based on field value

Post by bwalker » 2021-06-13 13:07

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
Attachments
2021-06-12_8-47-44.jpg
2021-06-12_8-47-44.jpg (122.67 KiB) Viewed 1072 times

bwalker
Posts: 13
Joined: 2021-05-24 22:30

Re: Row highlighting based on field value

Post by bwalker » 2021-06-13 14:51

The YT video demonstrates what I am trying to achieve and how:
https://youtu.be/DObUK-I-U8o

Alisson
Veteran Member
Posts: 81
Joined: 2017-02-25 20:32

Re: Row highlighting based on field value

Post by Alisson » 2021-06-14 01:22

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
.

bwalker
Posts: 13
Joined: 2021-05-24 22:30

Re: Row highlighting based on field value

Post by bwalker » 2021-06-14 03:28

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

bwalker
Posts: 13
Joined: 2021-05-24 22:30

Re: Row highlighting based on field value

Post by bwalker » 2021-06-14 05:17

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

Post Reply