Lightweight Dialog Class.
The code below lists all configuration options along with the default value.
If the default value is what you want you can leave it out:
var dlg = new Ext.BasicDialog('element-id', {
autoCreate: false, (true to auto create from scratch, or DomHelper Object)
title: null, (title to set at config time)
width: (css),
height: (css),
x: 200, //(defaults to center screen if blank)
y: 500, //(defaults to center screen if blank)
animateTarget: null,// (no animation) This is the id or element to animate from
resizable: true,
resizeHandles: 'all',
minHeight: 80,
minWidth: 200,
modal: false,
autoScroll: true,
closable: true,
constraintoviewport: true,
draggable: true,
autoTabs: false, (if true searches child nodes for elements with class x-dlg-tab and converts them to tabs)
tabTag: 'div', // the tag name of tab elements
proxyDrag: false, (drag a proxy element rather than the dialog itself)
fixedcenter: false,
shadow: false (Can be true or 'sides' for default, 'frame' for 4 way and 'drop' for drop shadow),
buttonAlign: 'right',
minButtonWidth: 75,
shim: false // true to create an iframe shim to
// keep selects from showing through
});
| |
BasicDialog(String/HTMLElement/Ext.Element el, Object config) |
BasicDialog |
| Create a new BasicDialog. |
| |
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 |
| |
center() : Ext.BasicDialog |
BasicDialog |
| Centers this dialog |
| |
destroy([Boolean removeEl]) : void |
BasicDialog |
| Destroys this dialog |
| |
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 |
| |
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) |
| |
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. |
addButton
public function addButton(String/Object config, Function handler, [Object scope])
Adds a button.
Parameters:
config : String/ObjectA string becomes the button text, an object is expected to be a valid Ext.DomHelper element config
handler : FunctionThe function called when the button is clicked
scope : Object(optional) The scope of the handler function
Returns:
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/ObjectEither 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 : FunctionThe function to call
scope : Object(optional) The scope of the function
Returns:
This method is defined by BasicDialog.
addListener
public function addListener(String eventName, Function handler, [Object options])
Appends an event handler to this component
center
public function center()
This method is defined by BasicDialog.
destroy
public function destroy([Boolean removeEl])
This method is defined by BasicDialog.
fireEvent
public function fireEvent(String eventName, Object... args)
Fires the specified event with the passed parameters (minus the event name).
getEl
public function getEl()
Returns the element for this dialog
This method is defined by BasicDialog.
getTabs
public function getTabs()
Returns the TabPanel component (if autoTabs)
This method is defined by BasicDialog.
hide
public function hide([Function callback])
This method is defined by BasicDialog.
initTabs
public function initTabs()
Reinitializes the tabs component, clearing out old tabs and finding new ones.
Parameters:
Returns:
Ext.TabPaneltabs The tabs component
This method is defined by BasicDialog.
isVisible
public function isVisible()
Returns true if the dialog is visible
This method is defined by BasicDialog.
moveTo
public function moveTo(Number x, Number y)
Moves the dialog to the specified point
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)
purgeListeners
public function purgeListeners()
Removes all listeners for this object
removeListener
public function removeListener(String eventName, Function handler, [Object scope])
resizeTo
public function resizeTo(Number width, Number height)
Resizes the dialog.
Parameters:
width : Numberheight : Number
Returns:
This method is defined by BasicDialog.
restoreState
public function restoreState()
Restores the previous state of the dialog if Ext.state is configured
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 : Numberheight : Number
Returns:
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
This method is defined by BasicDialog.
setTitle
public function setTitle(String text)
This method is defined by BasicDialog.
show
public function show([String/HTMLElement/Ext.Element animateTarget])
This method is defined by BasicDialog.
toBack
public function toBack()
Sends this dialog to the back (under) of any other visible dialogs
This method is defined by BasicDialog.
toFront
public function toFront()
Brings this dialog to the front of any other visible dialogs
This method is defined by BasicDialog.
un
public function un(String eventName, Function handler, [Object scope])
Removes a listener (shorthand for removeListener)
beforehide
public event beforehide
Fires before this dialog is hidden.
Subscribers will be called with the following parameters:
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 event is defined by BasicDialog.
hide
public event hide
Fires when this dialog is hidden.
Subscribers will be called with the following parameters:
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.BasicDialoge : 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.BasicDialogx : NumberThe new page X
y : NumberThe 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.BasicDialogwidth : NumberThe new width
height : NumberThe 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 event is defined by BasicDialog.