PDA

View Full Version : How do I get Spry Collapsible panel to work inside Repeat Region


woofy
02-13-2011, 01:36 AM
I am currently working on this problem, when placed in normally the only collapsible panel that works is the first one. So I used PHP and the record ID method to give each repeating panel a unique ID. However it doesn't work at all. I am posting the code I have for the entire region to see if anyone sees a problem or has a better solution.

<?php do { ?>
<br />
<a name="com" id="com"></a>
<?php if ($totalRows_rsCOMM > 0) { // Show if recordset not empty ?>
<table width="522" border="0" align="center" cellpadding="0" cellspacing="0" class="comtable">
<tr>
<td width="131" height="122" valign="bottom"><div align="center"><span class="comavatr"><a href="member_profile.php?MemberID=<?php echo $row_rsCOMM['cmmtr_ID']; ?>"><img src="http://www.comicracy.com/comimages/uploaded/<?php echo $row_rsCOMM['cmmtr_AVTR']; ?>" class="nobrderimages" /></a></span><br />
<span class="gentext1">&nbsp;</span><a href="member_profile.php?MemberID=<?php echo $row_rsCOMM['cmmtr_ID']; ?>" class="gentext2"><?php echo $row_rsCOMM['cmmtr']; ?></a></div></td>
<td width="419" valign="top" class="commmiddle">&quot; <span class="style7"><?php echo $row_rsCOMM['comment']; ?></span> &quot;</td>
</tr>
</table>
<script type="text/javascript">
<!--
var CollapsiblePanel<?php echo $row_rsCOMM['ID'];?> = new Spry.Widget.CollapsiblePanel("CollapsiblePanel<?php echo $row_rsCOMM['ID'];?>", {contentIsOpen:false});
//--></script>
<div id="CollapsiblePanel<?php echo $row_rsCOMM['ID']; ?> class="CollapsiblePanel">

<div class="CollapsiblePanelTab" tabindex="0">-REPLY to </div>
<div class="CollapsiblePanelContent">
<form id="form1" name="form1" method="post" action="">
<table width="120" border="0" align="center" cellpadding="4" cellspacing="0">
<tr>
<td bgcolor="#000000"><table width="291" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td width="287" bgcolor="#999999"><label>
<textarea name="comment2" id="comment2" cols="45" rows="5" onkeypress="return taLimit(this)" onkeyup="return taCount(this,'myCounter')" >@<?php echo $row_rsCOMM['cmmtr']; ?>-</textarea>
</label> </td>
</tr>
<tr>
<td bgcolor="#999999"><div align="center">
<label>
<div align="center" class="gentext1">You have <b class="style2"><span class="style3" id="myCounter2">500</span></b> characters remaining
for your comment...</font></div>
<div align="center">
<input type="submit" name="REPLY" id="REPLY" value="REPLY" />
<input name="commenter2" type="hidden" id="commenter2" value="<?php echo $row_rsCOMMENT['first_name']; ?>" />
<input name="commenterID2" type="hidden" id="commenterID2" value="<?php echo $row_rsCOMMENT['ID']; ?>" />
<input name="USERID2" type="hidden" id="USERID2" value="<?php echo $row_rsMEMBRS['ID']; ?>" />
<input name="avatar2" type="hidden" id="avatar2" value="<?php echo $row_rsCOMMENT['avatar']; ?>" />
</div>
</label></td>
</tr>
</table></td>
</tr>
</table>
</form>
</div>
</div>
<div align="center"></div>
<?php } // Show if recordset not empty ?>
<?php } while ($row_rsCOMM = mysql_fetch_assoc($rsCOMM)); ?>The section of the above script that I am particularly focus on is <script type="text/javascript">
<!--
var CollapsiblePanel<?php echo $row_rsCOMM['ID'];?> = new Spry.Widget.CollapsiblePanel("CollapsiblePanel<?php echo $row_rsCOMM['ID'];?>", {contentIsOpen:false});
//--></script>
<div id="CollapsiblePanel<?php echo $row_rsCOMM['ID']; ?> class="CollapsiblePanel"> - For reference I learned this technique from this page: http://www.webdevforums.com/showthread.php?27428-Dreamweaver-spry-collapsible-panel-amp-repeating-regions
It looks like it works on the html pages, each panel has a different name based on the ID... but it still doesn't work.

If you want to see the page I am working on its
http://www.comicracy.com/member_profile_alt.php?MemberID=1

I must be missing something here because in theory this should work... any suggestions?

gbwebsols
03-13-2011, 09:25 AM
Check out this page for the answer http://www.webdevforums.com/showthread.php?27428-Dreamweaver-spry-collapsible-panel-amp-repeating-regions