This is a very simple situation but I am surprised that there is no solution discussed or question asked or may be it is so simple that I am the only one stumped by it.
In any Accordion, in which the panel has menus, there will be situations when the Content panel must not be displayed because the Header itself is the only option (of the menu). The header itself processes the click event and does something without expanding the content panel.
So, I tried the following:
a. All possible ways to have CSS set the div
height of the content panel to zero, both static as well as dynamically, in various places, including in the activate
and beforeactivate
event handlers.
b. Added ui-state-disabled
class to the header in the create event handler. Works fine but has two minor issues. First the disabled header gets a different CSS and second when clicking on the header, other panels do not collapse as the disabling of the header stops the click event from propagating further and doing its work of collapsing the currently opened content-panel. There is no collapse method available to be called expressly.
c. Tried the solutions in how to disable certain links of jquery accordion. Does not work.
Can someone suggest any new approach? Problem stated differently, is to implement an Accordion-driven menu. Menu widgets are embedded in panels when there are multiple options. If single, then header of the Accordion itself is the clickable menu item/option.