John Ramsden
|
| Posted: 12/03/2002, 8:34 AM |
|
I have used CCS to wump up a simple PHP web page comprising
a grid that displays customer summary data, one customer per
line.
I need to replace the status value (currently 0, 1, 2) by
a small GIF image (a green, orange, or red disk resp).
From the CCS documentation, I can see it should be possible
to write an event procedure to do this; but the documentation
gives no examples of actually using event procedures. So I'd
be very grateful if someone could kindly sketch how something
like this could be done.
(To start with, just to see an event procedure in action,
I tried writing a BeforeShow() function comprising the line:
function BeforeShow ()
{
echo "in BeforeShow()<br>";
}
But nothing was displayed. So, just for starters, how would
one even do something as trivial as output in HTML a single
line in an event procedure?!
(I must say, although CCS itself looks promising, and I'm
slowly getting the hang of it, the documentation seems very
threadbare when it comes to customization examples.)
Cheers
John Ramsden (john_ramsden@sagitta-ps.com)
|
|
|
 |
RonB
|
| Posted: 12/03/2002, 2:35 PM |
|
First make sure the label that will hold the image is set to html.
add a beforeshow event to the label=>
global $yourgrid;
if($yourgrid->statusfield->Value == 0)
{
$yourgrid->statusfield->setvalue("<img src='./yourimagedirectory/green.gif'>");
}
elseif($yourgrid->statusfield->Value == 1)
{
$yourgrid->statusfield->setvalue("<img src='./yourimagedirectory/orange.gif'>");
}
elseif($yourgrid->statusfield->Value == 2)
{
$yourgrid->statusfield->setvalue("<img src='./yourimagedirectory/red.gif'>");
}
that'll do the trick
Ron
|
|
|
 |
|