如何让CFDIV每行下显示? [英] How to get the cfdiv to display under each line?

查看:115
本文介绍了如何让CFDIV每行下显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有记录的表,用户可以点击一个名字以示对某些记录更详细的信息。我有它设置了一个标记,但该链接被点击它每次只显示在页面的顶部或第一个行。有没有办法让它在每个名称显示,当它被点击。这里是code我有...

 <表格的宽度=75%的边界=1>
  &其中; TR>
    <第i个学生姓名< /第i个
  < / TR>
  < CFOUTPUT查询=Q>
  &其中; TR>
    &其中; TD>&所述; A HREF =javascript的:ColdFusion.navigate('detailedRecord.cfm RLN =#RLN#?,细节)>#Q.sln#,#Q.sfn#&所述; / a取代;< / TD>
  < / TR>
  &其中; TR>
    < TD>< CFDIV ID =细节>< / CFDIV>< / TD>
  < / TR>
  < / CFOUTPUT>
< /表>
 

解决方案

既然你是在一个循环< CFOUTPUT查询=Q> 您需要让详细信息 A的唯一的标识符。当你把它写你的循环每次迭代具有相同的ID。也许只是添加当前的行号,使其独特的。

 <表格的宽度=75%的边界=1>
  &其中; TR>
    <第i个学生姓名< /第i个
  < / TR>
  < CFOUTPUT查询=Q>
  &其中; TR>
    &其中; TD>&其中;一个href="javascript:ColdFusion.navigate('detailedRecord.cfm?RLN=#RLN#','detail#Q.CurrentRow#')">#Q.sln#, #Q.sfn#&所述; / a取代;&所述; / TD>
  < / TR>
  &其中; TR>
    < TD>< CFDIV ID =#详细#Q.CurrentRow>< / CFDIV>< / TD>
  < / TR>
  < / CFOUTPUT>
< /表>
 

I have a table of records and the user can click on a name to show more detailed information about that certain record. I have it set up with a tag but each time the link is clicked it only shows up on the top of the page or the very first row. Is there a way to get it to show under each name when it is click. Here is the code I have...

<table width="75%" border="1">
  <tr>
    <th>Student Name</th>
  </tr>
  <cfoutput query="Q">
  <tr>
    <td><a href="javascript:ColdFusion.navigate('detailedRecord.cfm?RLN=#RLN#','detail')">#Q.sln#, #Q.sfn#</a></td>
  </tr>
  <tr>
    <td><cfdiv id="detail"></cfdiv></td>
  </tr>
  </cfoutput>
</table>

解决方案

Since you are in a loop <cfoutput query="Q"> you will need to make detail a unique identifier. As you have it written every iteration of your loop has the same id. Maybe just add the current row number to make it unique.

<table width="75%" border="1">
  <tr>
    <th>Student Name</th>
  </tr>
  <cfoutput query="Q">
  <tr>
    <td><a href="javascript:ColdFusion.navigate('detailedRecord.cfm?RLN=#RLN#','detail#Q.CurrentRow#')">#Q.sln#, #Q.sfn#</a></td>
  </tr>
  <tr>
    <td><cfdiv id="detail#Q.CurrentRow#"></cfdiv></td>
  </tr>
  </cfoutput>
</table>

这篇关于如何让CFDIV每行下显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆