bstylen
02-01-2006, 10:26 PM
Nevermind....Got it working.
http://www.dynamicdrive.com/dynamicindex17/switchcontent2.htm
Little guidance for a novice would be greatly appreciated....
My page is ASP. Server side processing is connecting to a database, returning multiple recordsets, and building a table with multiple rows and sub-table/rows. The first column contains the +- images. I'm attempting to expand and contract the sub-data. The sub-data comes from a second recordset. I can get the 'expand all | contract all' to work. I've assigned a different "id=" in each of the table data elements that encapsulate a second table with the sub-data. I realize I'm struggle with the "id=" between the <td...><img...onclick=...>, but my javascript knowledge is to limited at this point to understand how to bridge the server side processing with the client side processing. Following is a cutout of the code:
While Not ToDoHeaderrs.EOF
response.Write "<TR bordercolor='" & arrColor(iIndex) & "' BGCOLOR='" & arrColor(iIndex) & "'>" & vbcrlf
%>
<TD class="headers" valign="middle" width="15"><img src="../Images/minus.gif" class="showstate" onClick="expandcontent(this, 'sc3')" /></td>
<%
response.Write "<TD valign='middle'><left><a class='normal' href='ToDoDetails.asp?ItemID=" & ToDoHeaderrs(0) & "'>" & ToDoHeaderrs(1) & "</a>" & "</TD>" & vbCrLf
response.write "<TD valign='middle'><center>" & ToDoHeaderrs(2) & "</TD>" & VBCrLf
response.write "<TD valign='middle'><center>" & ToDoHeaderrs(3) & "</TD>" & VBCrLf
response.write "<TD valign='middle'><center>" & ToDoHeaderrs(4) & "</TD>" & VBCrLf
response.write "<TD valign='middle'><center>" & ToDoHeaderrs(5) & "</TD>" & VBCrLf
response.Write "<TD valign='middle'><left><a class='normal' href='UpdToDo.asp?ItemID=" & ToDoHeaderrs(0) & "'>" & "Update" & "</a>" & "</TD>" & vbCrLf
response.Write "<TD valign='middle'><left><a class='normal' href='DelToDo.asp?ItemID=" & ToDoHeaderrs(0) & "'>" & "Delete" & "</a>" & "</TD>" & vbCrLf
response.Write "</TR>" & vbcrlf
response.Write "<TR>" & vbcrlf
' response.write "<TD class='switchcontent' id='sc3'>" & vbcrlf
response.write "<TD colspan='8' class='switchcontent' id=" & iExpand & ")>" & vbcrlf
DIM ItemID
ItemID=ToDoHeaderrs(0)
'***********************************************************************************************************
'Call Sub Routine
'***********************************************************************************************************
ToDoDetails ItemID
ToDoHeaderrs.Movenext
Thanks, bb
http://www.dynamicdrive.com/dynamicindex17/switchcontent2.htm
Little guidance for a novice would be greatly appreciated....
My page is ASP. Server side processing is connecting to a database, returning multiple recordsets, and building a table with multiple rows and sub-table/rows. The first column contains the +- images. I'm attempting to expand and contract the sub-data. The sub-data comes from a second recordset. I can get the 'expand all | contract all' to work. I've assigned a different "id=" in each of the table data elements that encapsulate a second table with the sub-data. I realize I'm struggle with the "id=" between the <td...><img...onclick=...>, but my javascript knowledge is to limited at this point to understand how to bridge the server side processing with the client side processing. Following is a cutout of the code:
While Not ToDoHeaderrs.EOF
response.Write "<TR bordercolor='" & arrColor(iIndex) & "' BGCOLOR='" & arrColor(iIndex) & "'>" & vbcrlf
%>
<TD class="headers" valign="middle" width="15"><img src="../Images/minus.gif" class="showstate" onClick="expandcontent(this, 'sc3')" /></td>
<%
response.Write "<TD valign='middle'><left><a class='normal' href='ToDoDetails.asp?ItemID=" & ToDoHeaderrs(0) & "'>" & ToDoHeaderrs(1) & "</a>" & "</TD>" & vbCrLf
response.write "<TD valign='middle'><center>" & ToDoHeaderrs(2) & "</TD>" & VBCrLf
response.write "<TD valign='middle'><center>" & ToDoHeaderrs(3) & "</TD>" & VBCrLf
response.write "<TD valign='middle'><center>" & ToDoHeaderrs(4) & "</TD>" & VBCrLf
response.write "<TD valign='middle'><center>" & ToDoHeaderrs(5) & "</TD>" & VBCrLf
response.Write "<TD valign='middle'><left><a class='normal' href='UpdToDo.asp?ItemID=" & ToDoHeaderrs(0) & "'>" & "Update" & "</a>" & "</TD>" & vbCrLf
response.Write "<TD valign='middle'><left><a class='normal' href='DelToDo.asp?ItemID=" & ToDoHeaderrs(0) & "'>" & "Delete" & "</a>" & "</TD>" & vbCrLf
response.Write "</TR>" & vbcrlf
response.Write "<TR>" & vbcrlf
' response.write "<TD class='switchcontent' id='sc3'>" & vbcrlf
response.write "<TD colspan='8' class='switchcontent' id=" & iExpand & ")>" & vbcrlf
DIM ItemID
ItemID=ToDoHeaderrs(0)
'***********************************************************************************************************
'Call Sub Routine
'***********************************************************************************************************
ToDoDetails ItemID
ToDoHeaderrs.Movenext
Thanks, bb