Change Row Colors on Child Tables

This sub-forum is for discussing all topics related to AppGini Helper JavaScript Library, provided by bizzworxx as a third-party AppGini plugin.
Post Reply
pvisser
Veteran Member
Posts: 38
Joined: 2013-10-30 12:48

Change Row Colors on Child Tables

Post by pvisser » 2022-01-01 14:40

Hello nthere, I would like to know if there is a way to change Child Table Row Colors like i did in for the tablename.php..

I have a table called "relaties.php" where i insert customers and a table "takenlijst.php". In the table "takenlijst.php" i can add tasks with a end date. Whe the end date is clossing, the row changes color.

I did the following in my footer_extras.php

Code: Select all

<script>
$j(function(){
$j('td.takenlijst-ta_startdatum a').each(function(){
    var ds = $j(this).html();
    /* assuming date format of due_date is month/day/year */
    var dc = new Date(ds.replace(/(\d{1,2})\/(\d{1,2})\/(\d{4})/, '$2/$1/$3'));
    var today = new Date();
    var days_ahead = parseInt((dc - today) / 86400 / 1000);
	if(days_ahead >= 14){
        // 14+ days left, use None highlighting
        //$j(this).addClass('text-success').parent().addClass('stripe');
		$j(this).parents().addClass('stripe');
	}else if(days_ahead >= 8){
		// 8+ days left, use green highlighting
		//$j(this).addClass('text-success').parent().addClass('success');
		$j(this).parents().addClass('success');
    }else if(days_ahead >= 3){
        // 3 days left, use yellow highlighting
        //$j(this).addClass('text-warning').parent().addClass('warning');
		$j(this).parents().addClass('warning');
    }else{
        // less than 3 days left, use red highlighting
        //$j(this).addClass('text-danger').parent().addClass('danger');
		$j(this).parents().addClass('danger');

 }
});
});
</script>
This is working fine for the table : takenlijst.php
tlcolor1.png
tlcolor1.png (81.9 KiB) Viewed 1827 times
Now the child table is not working with this look ad the screenshot
tlcolor2.png
tlcolor2.png (70.68 KiB) Viewed 1827 times

The table "relaties" is the Parent table
The table "takenlijst" is the Child table

Please see the screenshot its not changes the row color. Please show my how to do this? and advice.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Change Row Colors on Child Tables

Post by jsetzer » 2022-01-01 15:32

I think your question is not related to our AppGini Helper products. Please post your question in one of the main forums, instead.

If you need support or want to report a bug on AppGini Helper products, please send your Ordernumber to our helpdesk by email.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

pvisser
Veteran Member
Posts: 38
Joined: 2013-10-30 12:48

Re: Change Row Colors on Child Tables

Post by pvisser » 2022-01-01 15:34

Oke Im sorry,
I will do. Greetings. Can i move this one? or should i let it be?

Happy new Year,

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Change Row Colors on Child Tables

Post by jsetzer » 2022-01-01 16:06

If you want me to, I can delete your post here in this subforum.

But we can just leave it here for others.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

pvisser
Veteran Member
Posts: 38
Joined: 2013-10-30 12:48

Re: Change Row Colors on Child Tables

Post by pvisser » 2022-01-01 16:10

Oke thanks, I eave it here. Jan.

Post Reply