Loading Accordion Live Demo...
Ext Accordion Widget Example, Ver.: 1.0 (Latest: 1.0.1)
1. Introduction
The Accordion and its InfoPanel are components that can be used in the JavaScript enabled popular browsers: Firefox, Opera and Internet Explorer.
2. Ext JS Library
These components are not standalone but they require Ext JS Library version 1.0.1a to run. For more details see Ext JS - JavaScript Library. This library contains also many other useful components and provides a developer's framework.
3. Usage

The Accordion can be used anywhere in the web page mainly (but not only) for:

  • Page navigation
  • Tools windows
  • Hidable details
  • Login forms
  • Options dialogs
  • Sticky notes

... or anything else the talented web designers can invent and produce.

4. Drag & Drop

All panels are draggable and once undocked also resizable by default. You can try it by dragging a panel out of the Accordion dock. If you do not want this feature you can turn it off.

You can drag undocked panels back to the Accordion dock.

5. Configuration options

There are many configuration options to customize look and functionality for your needs, e.g. shadows, show pin, animation, various modes (undockable, independent) to name a few.

You can switch on/off some of them in the above toolbar.

Panels and dock can also keep their states (size, position, expanded, etc.) between page reloads.

7. Theme selector
Select the theme you like:
8. Donate

I have developed the Accordion because I needed it for my main project and not for profit. Only then I decided to share it with the community.

However, the developing and maintaining of this component takes time and effort so if you find it useful please donate to make future development possible.

 

Note: I have registered new PayPal account recently so if you see an "Unverified" warning it is only because the verification procedure takes a few days. Also, I'm new to the service so if you run into any other problems while trying to donate inform me please and I will fix them.

Important Information about this Example

Do not use this version unless you have some reasons to do so. Use latest version instead.

This is quickly-setup-page to show the status of the development of the Ext.Accordion extension class, to allow the potential users to get the feel-and-touch of accordion and panels and to find bugs, if any.

The ExtJS is the JavaScript library and it is used as a foundation for this example to work. For more information see Ext JS - JavaScript Library

This example is discussed in details in this forum thread. I have removed the standalone InfoPanel example as independent panels are now shown in the Panels tab. (If you navigate to infopanel.html your browser will be redirected back here.)

If you've already been here Ctrl+Click the Reload/Refresh button.

When I update sources sometimes I have to hard-refresh several times!


Visit also Saki's Extensions, Plugins and Know-How page.

Software on this page is provided as is in the hope that it will be useful with no direct or implied warranty whatsoever. You can use it, modify it, copy it or do anything else with it. Contact

How to integrate the Accordion to your page

Step by step instructions (Accordion is now Release Candidate 6, version 1.0 should follow.)

 

This howto is for those of you who would like to use the Accordion in your page. I'll write it as for beginners; I believe the old Ext-ers will forgive me if I'll stress the basics here. And you, eager beginners, be prepared to explore the new worlds of web design you maybe haven't even dreamed could exist.

Here we go:

1. Download and install Ext JS Library

For this, navigate to Download Ext JS Library page and download the Ext 1.0.1a version.

2. Install Ext JS Library on your server

To do this step navigate to Introduction to Ext and execute steps you find there up to the "Congratulations!" message box. I would strongly advice to read this tutorial fully but, for the impatient, it's enough to now that Ext is installed correctly in this step.

Install Ext to extjs/ directory under your server root directory

3. Make this example working on your server (unchanged)

For this, download the following files:

 

Place Accordion files into extjs/examples directory and icons files in the the img/silk/icons directory under your server root directory.

4. Navigate to http://yourdomain.com/extjs/examples/accordion.html

That's all folks!

Now it's time to put the Accordion to your page taking this running example as a model. You can also see this forum thread to see the discussion on the Accordion and to find out the outstanding issues/bugs and/or future plans.

Last but not least: If you find this component useful, donate please to make the future development of the Accordion possible. If you decide to donate use jsakalos at seznam dot cz as recipient's e-mail address. The amount is up to you. Thank you.

Happy coding!

 

Contact: If you want to contact me the best way is on the Ext JS Forums or via the Forum Private Messaging.

This page shows independent panels, panels without an Accordion, and various methods of panel creation. The creation method of each panel is explained in its body. Panel that comes last in the DOM is always the topmost panel.

These are independent panels placed in the plain div. They are neither draggable nor resizable and there is no Accordion used here.
1. Panel - expanded by default
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce pellentesque. Duis fermentum metus nec nisl. Suspendisse potenti. Vivamus id nibh ut neque sollicitudin ullamcorper. Vivamus quis augue. Nulla quis ante ut nunc scelerisque interdum. Phasellus sit amet eros. Aenean sodales nulla vel sem. Quisque posuere.
2. Panel - animation disabled
Nam venenatis nonummy quam. Integer semper. Ut eget dolor sed nunc ornare egestas. Donec eget quam eget ipsum semper tincidunt. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec sodales velit ac dolor. Fusce et odio in massa ultricies vehicula. Donec dui. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
3. Panel - only button expands
Ut placerat. Aenean quis erat. Suspendisse pede turpis, cursus at, dignissim eget, vulputate nec, turpis. Nunc ut nibh consectetuer nunc accumsan consequat. Quisque id purus. Mauris a lacus placerat libero dictum eleifend. Aenean sit amet pede vitae lectus egestas convallis. Phasellus vel quam vitae leo lobortis aliquet. Etiam imperdiet augue in orci. Aliquam vitae risus et lorem rutrum tincidunt. Ut ut dolor ac nisi eleifend pretium. Cras feugiat, erat a ornare vulputate, nisi ligula consequat odio, at lacinia nisl eros in libero. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla velit mauris, tempor nec, viverra porttitor, vestibulum posuere, tortor. Pellentesque facilisis. Vestibulum rutrum velit at lectus. Praesent leo.
5. Title and body from markup

Panel created from html markup

Markup:

<div>5. Panel</div>
<div>
  <div class="text-content">
    This text.
  </div>
</div>

Code:

new Ext.InfoPanel('ipanel-5', {
  useShadow: true
  , draggable: true
  , duration: 1.0
});

7. Auto-created, body from markup

 

Markup:

<div id="ipanel-7-body">
  <div class="text-content">
    <h3>7. Auto-created...</h3>
	<p>&nbsp;</p>
	<p>Markup:</p>
	...
  </div>
</div>

Code:

new Ext.InfoPanel({
    title: '7. Auto-created...'
  , id: 'ipanel-7'
  , desktop: 'panels-tab'
  , bodyEl: 'ipanel-7-body'
  , autoCreate: true
  , draggable: true
  , useShadow: true
  , resizable: true
});

This is the example of the fixed height Accordion. Panels undocked from this Accordion are local to the tab "Fixed height"; they hide when you change the tab. Left-hand panels are global to the page; they stay visible when you change the tab.

 

The Accordion is resizable down and right.

This example also shows how to use the wrapped Accordion. The html markup consists of three nested divisions each with its purpose.
<div id="acc2-ct">
 <div id="acc2-wrap">
  <div id="acc2-body">
  </div>
 </div>
</div>

acc2-ct is outermost container div that should have size and it is the div which is resized. Its id is used in new Ext.Accordion('acc2-ct', {...});

acc2-wrap is div that will be wrapped with nice surrounding. This div should have a border if you want one and its id is passed as wrapEl:'acc2-wrap' to the Accordion configuration.

acc2-body should not have any border nor margin and it is passed as body:'acc2-body' to the Accordion configuration. Panels are direct children of this division.

Panel 2-1
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce pellentesque. Duis fermentum metus nec nisl. Suspendisse potenti. Vivamus id nibh ut neque sollicitudin ullamcorper. Vivamus quis augue.
Panel 2-2
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce pellentesque. Duis fermentum metus nec nisl. Suspendisse potenti. Vivamus id nibh ut neque sollicitudin ullamcorper. Vivamus quis augue.
Panel 2-3
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce pellentesque. Duis fermentum metus nec nisl. Suspendisse potenti. Vivamus id nibh ut neque sollicitudin ullamcorper. Vivamus quis augue.
Panel 2-4
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce pellentesque. Duis fermentum metus nec nisl. Suspendisse potenti. Vivamus id nibh ut neque sollicitudin ullamcorper. Vivamus quis augue.
Panel 2-5
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce pellentesque. Duis fermentum metus nec nisl. Suspendisse potenti. Vivamus id nibh ut neque sollicitudin ullamcorper. Vivamus quis augue.

You are visitor number 2.7350860403798E+45 since 07 Mar 10.