saseow
Posts: 744
|
| Posted: 06/25/2009, 7:34 AM |
|
I have code that colors an event in a calendar depending on whether it is a critical event or not. All working beautifully until a client uses IE7...... no colors! So, after much playing around it appears that the <a> must be within the <li> and then it works? In other words, having the <a> tags within the <li> tags is correct HTML.
Now, my problem is that I cannot get this to work. Any help would be wonderful.
This is the line in the html:
<!-- BEGIN EventRow --><a href="{EventDescription_Src}" id="work_detailEventDescription">{EventDescription}</a> <!-- END EventRow -->
and this is code in the beforeshowrow event:
if ($Container->critical_path->GetValue() == "1") {
$Container->EventDescription->SetValue("<li class=\"critical_path_li\">".$Container->EventDescription->GetValue()."</li>");
}else{
$Container->EventDescription->SetValue("<li class=\"work_li\">".$Container->EventDescription->GetValue()."</li>");
}
Now, How on earth do I change the code so that the <a> comes between the <li>?
|
 |
 |
damian
Posts: 838
|
| Posted: 06/25/2009, 6:12 PM |
|
try this way - create label -
{mystartlist} and place like this -
<!-- BEGIN EventRow -->{mystartlist}<a href="{EventDescription_Src}" id="work_detailEventDescription">{EventDescription}</a> </li><!-- END EventRow -->
and place your event on the before show event of label:
if ($Container->critical_path->GetValue() == "1") {
$Component->SetValue("<li class=\"critical_path_li\">");
}else{
$Component->SetValue("<li class=\"work_li\">");
}
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
saseow
Posts: 744
|
| Posted: 06/26/2009, 4:25 AM |
|
Hi Damian,
Thank you for the reply. It does not work as is. I get a "Fatal error: Call to a member function GetValue() on a non-object in C:\php webs\job_management\calendar_all_events.php on line 15" error on the first line in the code.
You have given me an idea though and I will play some more later today.
Thank you so much,
Trevor
|
 |
 |
damian
Posts: 838
|
| Posted: 06/27/2009, 6:37 AM |
|
trevor your error suggests that the problem is in your section of the code where you are determining if it is a critical event or not....
we moved this from beforeshowrow to beforeshow on the label so look at that GetValue line or try moving the code back to beforeshowrow - you just wont be able to use $Component - you will need the full path...
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
saseow
Posts: 744
|
| Posted: 06/28/2009, 6:20 AM |
|
Hi Damian,
Once again you have come through with flying colors. This works very well!
Thank you very much!
Trevor
|
 |
 |