Manual:Widgets:Layouts:AccordionLayout (Legacy)

This version of our Learning Center is unmaintained.
This article may be out-of-date or contain incorrect information.
Please visit the new Sencha Learning Center for up-to-date material.

Go to the new Sencha Learning Center

From Sencha - Learn

Jump to: navigation, search

Ext Manual > Widgets > Layouts >

Ext.Accordion

Examples

Example 1

new Ext.Panel({
  renderTo:document.body,
  autoHeight: true,
  title: 'Accordion Layout',
  layout: 'accordion',
  defaults: {
    bodyStyle: 'padding:0.2em'
  },
  layoutConfig: {
    titleCollapse: true,
    animate: false,
    fill: false
  },
  items:[
    new Ext.Panel({
      title: 'My Panel 1',
      contentEl:"panel1-markup"
    }),
    new Ext.Panel({
      title: 'My Panel 2',
      contentEl:"panel2-markup"
    })
  ]
});

HTML markup - include this on the page to put content into the panels

<div style="display:none">
  <table id="panel1-markup">
    <tr><td>this is just some quick markup</td></tr>
    <tr><td>to show a table as content</td></tr>
  </table>
  <div id="panel2-markup">this is a different element that's
  populating the panel.</div>
</div>

Links

This page was last modified on 12 March 2008, at 16:20. This page has been accessed 7,175 times.