Hi,
I have the following code.
What I must do, and I don't know how, is that each time I click in one + column, the detail row will show, and this in any row, which will allow the users to compare the different clients (this is a small example, the page have more information). Like it is now, when I click the + column, I manage to show/hide only the first detail. Since I'm completely new in JScript, can any of you guys give me an idea on how to do it.
Thanks in advance
I have the following code.
Code:
<html>
<head>
<script type="text/javascript">
<!--
function showHideRow() {
if( document.getElementById('row2').style.display=='none' ){
document.getElementById('row2').style.display = '';
document.getElementById('plusminus').innerHTML = '-';
document.getElementById('plusminus').title = 'Hide detail';
}else{
document.getElementById('row2').style.display = 'none';
document.getElementById('plusminus').innerHTML = '+';
document.getElementById('plusminus').title = 'Show detail';
}
}
//-->
</script>
</head>
<body>
<cfquery name="qGetAS2" datasource="AAA">
SELECT AS2_DIR,
AS2_ADO_NUM,
AS2_BAS_LIN_DAT,
AS2_THI_PAR_NAM,
AS2_STATUS
FROM AS2
WHERE AS2_STATUS >= 0
ORDER BY AS2_STATUS,
AS2_DIR,
AS2_BAS_LIN_DAT DESC,
AS2_ADO_NUM DESC
</cfquery>
<table width="100%" border="1" cellpadding="2" cellspacing="0" align="center">
<tr>
<th> </th>
<th align="center"><br/>Dir.</th>
<th align="center"><br/>Number</th>
<th align="center">Baseline<br/>date</th>
<th align="center"><br/>Status</th>
</tr>
<cfoutput query="qGetAS2">
<tr>
<td align="center" id="plusminus" onclick="showHideRow()" title="Show detail">+</td>
<td align="center">#qGetAS2.AS2_DIR#</td>
<td align="center">#qGetAS2.AS2_ADO_NUM#</td>
<td align="center">#qGetAS2.AS2_BAS_LIN_DAT#</td>
<td align="center">#qGetAS2.AS2_STATUS#</td>
</tr>
<tr>
<td align="left" colspan="5" style="display:none" id="row2">#qGetAS2.AS2_THI_PAR_NAM#</td>
</tr>
</cfoutput>
</table>
</body>
</html>
What I must do, and I don't know how, is that each time I click in one + column, the detail row will show, and this in any row, which will allow the users to compare the different clients (this is a small example, the page have more information). Like it is now, when I click the + column, I manage to show/hide only the first detail. Since I'm completely new in JScript, can any of you guys give me an idea on how to do it.
Thanks in advance