CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Plugging image in Grid element

Print topic Send  topic

Author Message
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

   


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

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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