Jx.Button.Flyout

Extends: Jx.Button

Implements: Jx.ContentLoader, Jx.AutoPosition, Jx.Chrome

Flyout buttons expose a panel when the user clicks the button.  The panel can have arbitrary content.  You must provide any necessary code to hook up elements in the panel to your application.

When the panel is opened, the ‘open’ event is fired.  When the panel is closed, the ‘close’ event is fired.  You can register functions to handle these events in the options passed to the constructor (onOpen, onClose).

The user can close the flyout panel by clicking the button again, by clicking anywhere outside the panel and other buttons, or by pressing the ‘esc’ key.

Flyout buttons implement Jx.ContentLoader which provides the hooks to insert content into the Flyout element.  Note that the Flyout element is not appended to the DOM until the first time it is opened, and it is removed from the DOM when closed.

It is generally best to specify a width and height for your flyout content area through CSS to ensure that it works correctly across all browsers.  You can do this for all flyouts using the .jxFlyout CSS selector, or you can apply specific styles to your content elements.

A flyout closes other flyouts when it is opened.  It is possible to embed flyout buttons inside the content area of another flyout button.  In this case, opening the inner flyout will not close the outer flyout but it will close any other flyouts that are siblings.

Example

var flyout = new Jx.Button.Flyout({
     label: 'flyout',
     content: 'flyoutContent',
     onOpen: function(flyout) {
         console.log('flyout opened');
     },
     onClose: function(flyout) {
         console.log('flyout closed');
     }
});

Events

openthis event is triggered when the flyout is opened.
closethis event is triggered when the flyout is closed.

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
Jx.Button.FlyoutExtends: Jx.Button
Properties
contentthe HTML element that contains the flyout content
Constructor
initializeconstruct a new instance of a flyout button.
Functions
clickedOverride Jx.Button::clicked to hide/show the content area of the flyout.
hideCloses the flyout if open

Properties

content

the HTML element that contains the flyout content

Constructor

initialize

construct a new instance of a flyout button.  The single options argument takes a combination of options that apply to Jx.Button, Jx.ContentLoader, and Jx.AutoPosition.

Parameters

optionsan options object used to initialize the button, see Jx.Button.Options, Jx.ContentLoader.Options, and <Jx.AutoPosition.Options> for details.

Functions

clicked

clicked: function(e)

Override Jx.Button::clicked to hide/show the content area of the flyout.

Parameters

e{Event} the user event

hide

hide: function()

Closes the flyout if open

Extends: Object
clicked: function(e)
Override Jx.Button::clicked to hide/show the content area of the flyout.
clicked : function(evt)
triggered when the user clicks the button, processes the actionPerformed event
hide: function()
Closes the flyout if open
ContentLoader is a mix-in class that provides a consistent mechanism for other Jx controls to load content in one of four different ways:
Mix-in class that provides a method for positioning elements relative to other elements.
A mix-in class that provides chrome helper functions.