Print Friendly

Class Ext.LayoutDialog

Package:Ext
Class:LayoutDialog
Extends:BasicDialog
Defined In:BasicDialog.js
Dialog which provides adjustments for working with a layout in a Dialog. Add your neccessary layout config options to the dialogs config.
Example Usage (including a nested layout):
if(!dialog){
    dialog = new Ext.LayoutDialog("download-dlg", { 
            modal: true,
            width:600,
            height:450,
            shadow:true,
            minWidth:500,
            minHeight:350,
            autoTabs:true,
            proxyDrag:true,
            // layout config merges with the dialog config
            center:{
                tabPosition: 'top',
                alwaysShowTabs: true
            }
    });
    dialog.addKeyListener(27, dialog.hide, dialog);
    dialog.setDefaultButton(dialog.addButton('Close', dialog.hide, dialog));
    dialog.addButton('Build It!', this.getDownload, this);
    
    // we can even add nested layouts
    var innerLayout = new Ext.BorderLayout('dl-inner', {
        east: {
            initialSize: 200,
            autoScroll:true,
            split:true
        },
        center: {
            autoScroll:true
        }
    });
    innerLayout.beginUpdate();
    innerLayout.add('east', new Ext.ContentPanel('dl-details'));
    innerLayout.add('center', new Ext.ContentPanel('selection-panel'));
    innerLayout.endUpdate(true);
    
    var layout = dialog.getLayout();
    layout.beginUpdate();
    layout.add('center', new Ext.ContentPanel('standard-panel', 
                        {title: 'Download the Source', fitToFrame:true}));
    layout.add('center', new Ext.NestedLayoutPanel(innerLayout, 
               {title: 'Build your own yui-ext.js'}));
    layout.getRegion('center').showPanel(sp);
    layout.endUpdate();

Properties   -  Methods   -  Events

Public Properties

Property Defined By
  body : Ext.Element BasicDialog
The body element
  footer : Ext.Element BasicDialog
The footer element
  header : Ext.Element BasicDialog
The header element

Public Methods

Method Defined By
  LayoutDialog(String/HTMLElement/Ext.Element el, Object config) LayoutDialog
  addButton(String/Object config, Function handler, [Object scope]) : Ext.Button BasicDialog
Adds a button.
  addKeyListener(Number/Array/Object key, Function fn, [Object scope]) : Ext.BasicDialog BasicDialog
Adds a key listener for when this dialog is displayed
  addListener(String eventName, Function handler, [Object options]) : void Observable
Appends an event handler to this component
  beginUpdate() : void LayoutDialog
Deprecated. Begins an update of the layout and sets display to block and visibility to hidden. Use standard beginUpda...
  center() : Ext.BasicDialog BasicDialog
Centers this dialog
  destroy([Boolean removeEl]) : void BasicDialog
Destroys this dialog
  endUpdate() : void LayoutDialog
Deprecated. Ends update of the layout and resets display to none. Use standard beginUpdate/endUpdate on the layout.
  fireEvent(String eventName, Object... args) : Boolean Observable
Fires the specified event with the passed parameters (minus the event name).
  getEl() : Ext.Element BasicDialog
Returns the element for this dialog
  getLayout() : Ext.BorderLayout LayoutDialog
Get the BorderLayout for this dialog
  getTabs() : Ext.TabPanel BasicDialog
Returns the TabPanel component (if autoTabs)
  hide([Function callback]) : Ext.BasicDialog BasicDialog
Hides the dialog.
  initTabs() : Ext.TabPanel BasicDialog
Reinitializes the tabs component, clearing out old tabs and finding new ones.
  isVisible() : Boolean BasicDialog
Returns true if the dialog is visible
  moveTo(Number x, Number y) : Ext.BasicDialog BasicDialog
Moves the dialog to the specified point
  on(String eventName, Function handler, [Object options]) : void Observable
Appends an event handler to this element (shorthand for addListener)
  purgeListeners() : void Observable
Removes all listeners for this object
  removeListener(String eventName, Function handler, [Object scope]) : void Observable
Removes a listener
  resizeTo(Number width, Number height) : Ext.BasicDialog BasicDialog
Resizes the dialog.
  restoreState() : Ext.BasicDialog BasicDialog
Restores the previous state of the dialog if Ext.state is configured
  setContentSize(Number width, Number height) : Ext.BasicDialog BasicDialog
Resizes the dialog to fit the specified content size.
  setDefaultButton(Ext.BasicDialog.Button btn) : Ext.BasicDialog BasicDialog
Sets the default button to be focused when the dialog is displayed
  setTitle(String text) : Ext.BasicDialog BasicDialog
Sets the dialog title.
  show([String/HTMLElement/Ext.Element animateTarget]) : Ext.BasicDialog BasicDialog
Shows the dialog.
  toBack() : Ext.BasicDialog BasicDialog
Sends this dialog to the back (under) of any other visible dialogs
  toFront() : Ext.BasicDialog BasicDialog
Brings this dialog to the front of any other visible dialogs
  un(String eventName, Function handler, [Object scope]) : void Observable
Removes a listener (shorthand for removeListener)

Public Events

Event Defined By
  beforehide : (Ext.BasicDialog this) BasicDialog
Fires before this dialog is hidden.
  beforeshow : (Ext.BasicDialog this) BasicDialog
Fires before this dialog is shown.
  hide : (Ext.BasicDialog this) BasicDialog
Fires when this dialog is hidden.
  keydown : (Ext.BasicDialog this, Ext.EventObject e) BasicDialog
Fires when a key is pressed
  move : (Ext.BasicDialog this, Number x, Number y) BasicDialog
Fires when this dialog is moved by the user.
  resize : (Ext.BasicDialog this, Number width, Number height) BasicDialog
Fires when this dialog is resized by the user.
  show : (Ext.BasicDialog this) BasicDialog
Fires when this dialog is shown.

Property Details

body

public Ext.Element body
The body element
This property is defined by BasicDialog.

footer

public Ext.Element footer
The footer element
This property is defined by BasicDialog.

header

public Ext.Element header
The header element
This property is defined by BasicDialog.

Constructor Details

LayoutDialog

public function LayoutDialog(String/HTMLElement/Ext.Element el, Object config)
Parameters:
  • el : String/HTMLElement/Ext.Element
    The id of or container element
  • config : Object
    configuration options

Method Details

addButton

public function addButton(String/Object config, Function handler, [Object scope])
Adds a button.
Parameters:
  • config : String/Object
    A string becomes the button text, an object is expected to be a valid Ext.DomHelper element config
  • handler : Function
    The function called when the button is clicked
  • scope : Object
    (optional) The scope of the handler function
Returns:
  • Ext.Button
This method is defined by BasicDialog.

addKeyListener

public function addKeyListener(Number/Array/Object key, Function fn, [Object scope])
Adds a key listener for when this dialog is displayed
Parameters:
  • key : Number/Array/Object
    Either the numeric key code, array of key codes or an object with the following options: {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
  • fn : Function
    The function to call
  • scope : Object
    (optional) The scope of the function
Returns:
  • Ext.BasicDialog
    this
This method is defined by BasicDialog.

addListener

public function addListener(String eventName, Function handler, [Object options])
Appends an event handler to this component
Parameters:
  • eventName : String
    The type of event to listen for
  • handler : Function
    The method the event invokes
  • options : Object
    (optional)
Returns:
  • void
This method is defined by Observable.

beginUpdate

public function beginUpdate()
Deprecated. Begins an update of the layout and sets display to block and visibility to hidden. Use standard beginUpdate/endUpdate on the layout.
Parameters:
  • None.
Returns:
  • void
This method is defined by LayoutDialog.

center

public function center()
Centers this dialog
Parameters:
  • None.
Returns:
  • Ext.BasicDialog
    this
This method is defined by BasicDialog.

destroy

public function destroy([Boolean removeEl])
Destroys this dialog
Parameters:
  • removeEl : Boolean
    (optional) true to remove the element from the DOM
Returns:
  • void
This method is defined by BasicDialog.

endUpdate

public function endUpdate()
Deprecated. Ends update of the layout and resets display to none. Use standard beginUpdate/endUpdate on the layout.
Parameters:
  • None.
Returns:
  • void
This method is defined by LayoutDialog.

fireEvent

public function fireEvent(String eventName, Object... args)
Fires the specified event with the passed parameters (minus the event name).
Parameters:
  • eventName : String
  • args : Object...
    Variable number of parameters are passed to handlers
Returns:
  • Boolean
    returns false if any of the handlers return false otherwise it returns true
This method is defined by Observable.

getEl

public function getEl()
Returns the element for this dialog
Parameters:
  • None.
Returns:
  • Ext.Element
This method is defined by BasicDialog.

getLayout

public function getLayout()
Get the BorderLayout for this dialog
Parameters:
  • None.
Returns:
  • Ext.BorderLayout
This method is defined by LayoutDialog.

getTabs

public function getTabs()
Returns the TabPanel component (if autoTabs)
Parameters:
  • None.
Returns:
  • Ext.TabPanel
This method is defined by BasicDialog.

hide

public function hide([Function callback])
Hides the dialog.
Parameters:
  • callback : Function
    (optional) Function to call when the dialog is hidden
Returns:
  • Ext.BasicDialog
    this
This method is defined by BasicDialog.

initTabs

public function initTabs()
Reinitializes the tabs component, clearing out old tabs and finding new ones.
Parameters:
  • None.
Returns:
  • Ext.TabPanel
    tabs The tabs component
This method is defined by BasicDialog.

isVisible

public function isVisible()
Returns true if the dialog is visible
Parameters:
  • None.
Returns:
  • Boolean
This method is defined by BasicDialog.

moveTo

public function moveTo(Number x, Number y)
Moves the dialog to the specified point
Parameters:
  • x : Number
  • y : Number
Returns:
  • Ext.BasicDialog
    this
This method is defined by BasicDialog.

on

public function on(String eventName, Function handler, [Object options])
Appends an event handler to this element (shorthand for addListener)
Parameters:
  • eventName : String
    The type of event to listen for
  • handler : Function
    The method the event invokes
  • options : Object
    (optional)
Returns:
  • void
This method is defined by Observable.

purgeListeners

public function purgeListeners()
Removes all listeners for this object
Parameters:
  • None.
Returns:
  • void
This method is defined by Observable.

removeListener

public function removeListener(String eventName, Function handler, [Object scope])
Removes a listener
Parameters:
  • eventName : String
    The type of event to listen for
  • handler : Function
    The handler to remove
  • scope : Object
    (optional) The scope (this object) for the handler
Returns:
  • void
This method is defined by Observable.

resizeTo

public function resizeTo(Number width, Number height)
Resizes the dialog.
Parameters:
  • width : Number
  • height : Number
Returns:
  • Ext.BasicDialog
    this
This method is defined by BasicDialog.

restoreState

public function restoreState()
Restores the previous state of the dialog if Ext.state is configured
Parameters:
  • None.
Returns:
  • Ext.BasicDialog
    this
This method is defined by BasicDialog.

setContentSize

public function setContentSize(Number width, Number height)
Resizes the dialog to fit the specified content size.
Parameters:
  • width : Number
  • height : Number
Returns:
  • Ext.BasicDialog
    this
This method is defined by BasicDialog.

setDefaultButton

public function setDefaultButton(Ext.BasicDialog.Button btn)
Sets the default button to be focused when the dialog is displayed
Parameters:
  • btn : Ext.BasicDialog.Button
    The button object returned by addButton
Returns:
  • Ext.BasicDialog
    this
This method is defined by BasicDialog.

setTitle

public function setTitle(String text)
Sets the dialog title.
Parameters:
  • text : String
Returns:
  • Ext.BasicDialog
    this
This method is defined by BasicDialog.

show

public function show([String/HTMLElement/Ext.Element animateTarget])
Shows the dialog.
Parameters:
  • animateTarget : String/HTMLElement/Ext.Element
    (optional) Reset the animation target
Returns:
  • Ext.BasicDialog
    this
This method is defined by BasicDialog.

toBack

public function toBack()
Sends this dialog to the back (under) of any other visible dialogs
Parameters:
  • None.
Returns:
  • Ext.BasicDialog
    this
This method is defined by BasicDialog.

toFront

public function toFront()
Brings this dialog to the front of any other visible dialogs
Parameters:
  • None.
Returns:
  • Ext.BasicDialog
    this
This method is defined by BasicDialog.

un

public function un(String eventName, Function handler, [Object scope])
Removes a listener (shorthand for removeListener)
Parameters:
  • eventName : String
    The type of event to listen for
  • handler : Function
    The handler to remove
  • scope : Object
    (optional) The scope (this object) for the handler
Returns:
  • void
This method is defined by Observable.

Event Details

beforehide

public event beforehide
Fires before this dialog is hidden.
Subscribers will be called with the following parameters:
  • this : Ext.BasicDialog
This event is defined by BasicDialog.

beforeshow

public event beforeshow
Fires before this dialog is shown.
Subscribers will be called with the following parameters:
  • this : Ext.BasicDialog
This event is defined by BasicDialog.

hide

public event hide
Fires when this dialog is hidden.
Subscribers will be called with the following parameters:
  • this : Ext.BasicDialog
This event is defined by BasicDialog.

keydown

public event keydown
Fires when a key is pressed
Subscribers will be called with the following parameters:
  • this : Ext.BasicDialog
  • e : Ext.EventObject
This event is defined by BasicDialog.

move

public event move
Fires when this dialog is moved by the user.
Subscribers will be called with the following parameters:
  • this : Ext.BasicDialog
  • x : Number
    The new page X
  • y : Number
    The new page Y
This event is defined by BasicDialog.

resize

public event resize
Fires when this dialog is resized by the user.
Subscribers will be called with the following parameters:
  • this : Ext.BasicDialog
  • width : Number
    The new width
  • height : Number
    The new height
This event is defined by BasicDialog.

show

public event show
Fires when this dialog is shown.
Subscribers will be called with the following parameters:
  • this : Ext.BasicDialog
This event is defined by BasicDialog.

yui-ext - Copyright © 2006 Jack Slocum. | Yahoo! UI - Copyright © 2006 Yahoo! Inc.
All rights reserved.