Page 1 of 1

Change Row Colors on Child Tables

Posted: 2022-01-01 14:40
by pvisser
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 3673 times
Now the child table is not working with this look ad the screenshot
tlcolor2.png
tlcolor2.png (70.68 KiB) Viewed 3673 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.

Re: Change Row Colors on Child Tables

Posted: 2022-01-01 15:32
by jsetzer
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.

Re: Change Row Colors on Child Tables

Posted: 2022-01-01 15:34
by pvisser
Oke Im sorry,
I will do. Greetings. Can i move this one? or should i let it be?

Happy new Year,

Re: Change Row Colors on Child Tables

Posted: 2022-01-01 16:06
by jsetzer
If you want me to, I can delete your post here in this subforum.

But we can just leave it here for others.

Re: Change Row Colors on Child Tables

Posted: 2022-01-01 16:10
by pvisser
Oke thanks, I eave it here. Jan.