Posts

Showing posts from March, 2011

Expand All / Collapse All panes in Ajax Accordion Extender

There is no direct way to Expand/Collapse all panes in Accordion Extender. Using following java script, Accordion can be Expand/Collapse all panes in one click. Expand All :             var behavior = $get("<%=accMain.ClientID%>").AccordionBehavior;             for (var i = 0; i < behavior._panes.length; i++) {                 behavior.get_Pane(i).content.style.display = 'block';                 behavior.get_Pane(i).content.height = behavior.get_Pane(i).content.scrollHeight;                 behavior.get_Pane(i).content.style.height = behavior.get_Pane(i).content.scrollHeight + 'px';             } Collapse All :             var behavior = $get("<%=accMain.ClientID%>").AccordionBehavior;             for (var i = 0; i < behavior._panes.length; i++) {                 behavior.get_Pane(i).content.style.display = 'none';                 behavior.get_Pane(i).content.height = 0;                 behavior.get_Pane