CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 [TIP] Changing Row color attributes

Print topic Send  topic

Author Message
ckroon

Posts: 869
Posted: 06/18/2008, 7:07 PM

Anyone in the mood to give short tutorial?
I have played with the attributes examples in the help file but I have come to an impasse.

I need a row bg color to change to a light shade of red if a database lookup returns a certain value for the row.

For instance.

If the 'studentid' label of the record in the row has a corresponding "Yes" in the 'Inactive' field of the 'class' table... that row should have the attribute trigger.

Any takers out there?


_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
wkempees


Posts: 1679
Posted: 06/19/2008, 3:05 AM

No not in the mood but:
make sure you have the grids data row:
<tr class="Row"> needs to be <tr {gridname:attribname}>

gridname= the name of your grid, attribname the name of the attribute (you give it a name)
Why? Because this: <tr class="Row" style="BACKGROUND: RED"> does not work.
The background color is set by the class Row, so we need to get rid of the class and set the BACKGROUND ourselves and <tr bgcolor=> is no longer valid HTML.

Do this first:
In the Before Show Row Event:
  
 $Component->Attributes->SetValue('rowcollored', ' style=" BACKGROUND: Red " ');  
to colour all rows red, test it.
      
  $Component->Attributes->SetValue('rowcollored', 'class="Row"');  
to reset to standard CCS CSS setting, test it.

Once you have both statements tested and working, then you start thinking about the condition......
In the Before Show Row Event:
  
IF ( 1 == 1 ) // always true for testing  
 $Component->Attributes->SetValue('rowcollored', ' style=" BACKGROUND: Red " ');  
ELSE      
  $Component->Attributes->SetValue('rowcollored', 'class="Row"');  

Of course you define the condition, at which time ( 1==1 ) needs to be replaced by your condition.


Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
ckroon

Posts: 869
Posted: 06/19/2008, 11:55 AM

Screw the cookies.. Walter gets CAKE!
Thanks man! :-D
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.