View Full Version : Two Instances of ddAccordion, one controlling the other / ASP.NET

03-14-2013, 05:58 PM
I'm wondering if there's a way to have two DDACCORDION controls (http://www.dynamicdrive.com/dynamicindex17/ddaccordion_suppliment2.htm) stacked on top of each other, and have the top one control the content of the bottom.

I'm not sure I'll be able to use an iFrame, as the bottom control's height is going to vary wildly, and may be the object that extends the page beyond the body content. I haven't tried that yet, but I imagine it's going to be squirrely.

So what I have is something like this (it's not this, but for sample, it almost works)

======================== ddAccordion 1: Category
[our appetizers are home made blah blah blah]
======================== ddAccordion 2: Detail
[deep fried to a golden brown, served with blah blah blah]

There will be only one open at a time. So when you drop, Appetizers is open, as is Onion Rings as the first / default option. When you click on BREAKFAST, the ddAccordion2 should "go away" and be replaced with a new one with OMELETTE, PANCAKES, etc. Not every menu item will be listed, so it's not controlling the second one from the top one, it's effectively replacing the bottom one with the top one.

I'm using ASP.NET AJAX for all of this, and my "raw" Ajax skills are pretty meager. I'm not sure what I'd be able to do with OnInit, maybe I just load all of the items, and do a show/hide of the ones that are there... hrmmm... There will be up to 15 "categories", and potentially 100s of "Details" in my application.

There seem to be many ways to skin this cat, and I'm wondering if there's anything relatively easy to do, and if not easy, stable in most browsers. I don't know if there's any canned support for something like this that I'm missing, in part because I'm fetching my data with asp.net and have the vertical problem with using an iFrame.


Thanks much!

03-15-2013, 05:22 PM
A cleaner way to do this may be to just implement a nested Accordion Menu. If you look at the 2nd example on this page (http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-bullet.htm), it shows such an Accordion in action.

03-15-2013, 05:44 PM
That is damn sexy. :)

I did not see that example, that's awesome. I implemented it with a show/hide of DIVs, works nicely, but with this nesting and potential to load on expand, this IS a much cleaner way.

Thanks DDA!