Nikko2 wrote:
> I try to make a "collapsible spry widget" repeating
dynamical (by a recordset
> (I tried also with spry data-xml))
> get the same problem, the first collaps work fine but
the other are open and
> do not work,
> Does anyone know if it is possible to do so ?
What you've done with your code is to give each code block
that would ordinarily create a collapsible panel and repeated
everything. However that code block depends on the wrapper DIV to
have a unique id. So you've got a couple of choices, one: increment
the id for the wrapper block so that it changes from
CollapsiblePanel1 to CollapsiblePanel2, etc. YOu can do this with
code similar to the following:
<?php
$counter = 1;
?>
<?php do { ?>
<div id="CollapsiblePanel<?php echo ($counter); ?>"
class="CollapsiblePanel">
.....rest of code here.....
Then you'll need to reset the recordset (see the code added
when populating a select list with dynamic data from a recordset),
and then do a repeat around the script block at the end and also
increment the id that is passed into the Collapsible panel
constructor.
*Or* you can use a Collapsible Panel Group and combine that
with incremented id for the panel wrapper DIV (code shown above).
You can see an example here (check the source code for the page):
http://labs.adobe.com/technologies/spry/samples/collapsiblepanel/CollapsiblePanelGroupSample.html
Note that a set of panels are wrapped with a div similar to
this:
<div id="CollapsiblePanelGroup1"
class="CollapsiblePanelGroup">
</div>
And then to create the group you use code similar to the
following code to replace the current script block:
<script language="JavaScript" type="text/javascript">
var cpg1 = new
Spry.Widget.CollapsiblePanelGroup("CollapsiblePanelGroup1");
</script>
--
Danilo Celic
|
http://blog.extensioneering.com/
| WebAssist Extensioneer
| Adobe Community Expert