I'd do it with jQuery. Here's a sample if you're using tables:
<style type="text/css">
table, tr, td {
border-collapse: collapse;
border: solid 1px #ccc;
padding: 5px;
}
.group {
cursor: pointer;
}
.item {
display: none;
}
</style>
<script type="text/javascript" src="/scripts/jquery-1.2.6.min.js"></script>
<script type="text/javascript">
$(function() {
$(".group").click(function() {
var groupID = getID(this.id);
var items = $(".group-" + groupID);
items.toggle();
});
});
function getID(input) {
return input.split("-")[1];
}
</script>
<table>
<tr><td colspan="2" class="group" id="group-1">GROUP 1</td></tr>
<tr class="item group-1">
<td>Item A</td>
<td>[edit][delete][preview]</td>
</tr>
<tr class="item group-1">
<td>Item B</td>
<td>[edit][delete][preview]</td>
</tr>
<tr class="item group-1">
<td>Item C</td>
<td>[edit][delete][preview]</td>
</tr>
<tr><td colspan="2" class="group" id="group-2">GROUP 2</td></tr>
<tr class="item group-2">
<td>Item A</td>
<td>[edit][delete][preview]</td>
</tr>
<tr class="item group-2">
<td>Item B</td>
<td>[edit][delete][preview]</td>
</tr>
</table>
> -----Original Message-----
> From: Les Mizzell [mailto:[email protected]]
> Sent: 08 January 2009 20:59
> To: cf-talk
> Subject: Point me in the right direction - expand a category from a
> query...
>
> I've *finally* gotten my main client to upgrade to CF8. So, up until
> this point, I've not really had time to dive into it too deep and am
> just learning my way around the new stuff.
>
> Ok, I've got an admin page with a number of records sorted by
> categories
> set up like this (cfouput with "group")
>
> GROUP 1
> Item A - [edit][delete][preview]
> Item B - [edit][delete][preview]
> Item C - [edit][delete][preview]
> GROUP 2
> Item A - [edit][delete][preview]
> Item B - [edit][delete][preview]
>
> .......
>
> Blah, blah...
>
> What's the best way to collapse the sub items so when you first visit
> the page you just see the groups - click a group and it expands to show
> the categories with edit buttons and such underneath.
>
> I know there's a dozen CSS or javascript ways to do it. Is there
> anything in CF8 built in that would make it easier.
>
> Looks like cftree would be close maybe?
>
> If not, no problem. I just go back to my other methods.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317626
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4