Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / May 2008



Tip: Looking for answers? Try searching our database.

Cfgrid html and href

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lrsorey - 09 May 2008 23:17 GMT
Hello All,

I am using cfgrid Format=HTML. I have no problem with populating the grid from
a query. My problem comes from
the href text box in the grid. I have a variable name like the following:

/l/listing/tag/#gettopcat.categoryName#.html

Where categoryName is the name of the column being populated. I have around 40
items in the grid list but the only
href that works properly is the first item in the grid. Every item in the grid
goes to the href for the first item in the grid.

Is this possible with cfgrid?

Can anyone point me to a better solution where I can have a grid with a
vertical scroll and item as href items when I click I can get to the proper
page?

Thanks.
Azadi - 10 May 2008 06:16 GMT
where and how do you set your variable?

does changing it to
/l/listing/tag/#gettopcat.categoryName[gettopcat.currentrow]#.html help?

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
lrsorey - 10 May 2008 16:12 GMT
Hello Azadi,

Thanks for your response.

Unfortunately this did not work.

Variables are set from the query that populates the grid.

I am at a loss on what to do to make this work.

Strange that the href only can find the first item in the grid list.

lrsorey
Azadi - 11 May 2008 01:32 GMT
it's not strange at all. your href is not inside a cfloop or cfoutput,
so any reference to a query column will reference the first row only.

one thing you can do is add a column that contains the full href text to
your query, i.e.:

SELECT categoryID, categoryName, CONCAT('/l/listing/tag/', categoryName,
'.html') AS hreflink
FROM...

the above syntax is for MySQL, but your db will have its own CONCAT()
function equivalent.

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.