CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Showing grid links as labels depending on value

Print topic Send  topic

Author Message
teufel
Posted: 11/06/2002, 5:12 AM

Hi,

I need to 'disable' some links in a grid depending on the value of the link. That is: some records will have links to its detail page and others not, thus avoiding the user to edit some specific records.

I understand the code for a link is generated on the fly, but the 'href' tag is present inside the HTML template.

Any suggestions of how to do that? Is that even possible?

TIA
RonB
Posted: 11/08/2002, 4:25 AM

Without knowing how the table containing the links is setup this is not easy to answer. There are several ways to do this depending on what you want.
(I'm guessing your link table contains at least 3 fields:
link_id(number) link_name(text) and link_url(the actual link))

a. Links are stored as text not html i.e. as index.php and not as <a href=....
- do a beforeshow event on the label(for this example I'm asuming you use link_text as the label and that label has content set to html)

global $gridname;
if(link_id <> somevalue)
{
$gridname->link_text->setvalue("<a href='"
.$gridname->link_url>Value ."'>" .$gridname->link_text->Value ."</a>");
}

this will get you clickable links when if statement returns true and plain text if it returns false

I'd recommend another setup though:
in your linktable make sure you have the following fileds:
link_id (number)
link_url(<a href=...)
link_active(value 1 is yes 2 is no)

now all you have to do is set the value for active and only those links will show up if you include the link_active part in your where clause (where link_active=1)

I use the above setup for development fase. The intranet only shows links where active is 1, the development fase uses the same database and webserver but I only add the where clause on the new page just before publishing so the link to the new page only shows up on the intranet when the page is done. Until that time the value for active on the new links is 2

   


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

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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