CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 RESOLVED:Change calendar cell color

Print topic Send  topic

Author Message
ckroon

Posts: 869
Posted: 01/13/2011, 1:30 PM

In a calendar table I have a field called color.

That field will be in the calendar cell as a Hidden field.

the text in the db table will either be "red" or "green" or blank.

what is a sample of some Before Show code that will grab the value of the Hiddne field and change the color of the days cell BG to the color indicated?



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

Posts: 35
Posted: 01/14/2011, 1:07 PM

Create a Hidden field after day number in the calendar linked to database field
Create an Label1 no database field content set to html

In the Before Show of the Hidden Field insert the following custom code

//Custom Code

if ($Component->GetValue()==1 {
$Container->Label1->SetValue('style="background-color: green;"');
}
else ($Component->GetValue()==2) {
$Container->Label1->SetValue('style="background-color: red;"');
}

//End Custom Code

If the Hidden field equals 1 then the background is red or if the Hidden field equals 2 then iits green
View profile  Send private message
ckroon

Posts: 869
Posted: 01/16/2011, 10:22 PM

Thanks for the help Jerry.. but I think I am missing something.. probably something obvious.

Followed your instructions to a T,,

Now, next to the Day Number field is Text: style="background-color: red;"

I changed the properties of Label1 to html.. same thing.
I also tried $Component->Label1->Attributes->SetValue(....

What did I miss?

Thanks!

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

Posts: 869
Posted: 01/17/2011, 8:19 AM

I tried that Jerry... still no luck.
Any other ideas?
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
ckroon

Posts: 869
Posted: 01/17/2011, 9:07 AM

Here is a sample of the html

<td nowrap class="CalendarDay">25 <input id="FamilyCalendarcolor" value="1" type="hidden" name="color">style="background-color: green;"   

This is the html where Lbel1 sits

 <!-- BEGIN Day -->  
                      <td nowrap {Style}>{DayNumber} <input id="FamilyCalendarcolor" value="{color}" type="hidden" name="{color_Name}">{Label1} 

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

Posts: 35
Posted: 01/17/2011, 11:48 AM

Its is a database Label which does not display on the page.

I have sent a demo to your PM
View profile  Send private message
ckroon

Posts: 869
Posted: 01/17/2011, 2:25 PM

Thanks Jerry!
All set!
_________________
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.