Properties Methods Events Config Options Direct Link
Observable
  Component
    Component
      Container
        Container
          Panel
            Panel
              Sheet
                MessageBox

Class Ext.MessageBox

Package:Ext
Defined In:MessageBox.js
Class:MessageBox
Extends:Sheet

Utility class for generating different styles of message boxes. The framework provides a global singleton Ext.Msg for common usage.

Note that the MessageBox is asynchronous. Unlike a regular JavaScript alert (which will halt browser execution), showing a MessageBox will not cause the code to stop. For this reason, if you have code that should only run after some user feedback from the MessageBox, you must use a callback function (see the fn configuration option parameter for the show method for more details).

Screenshot

Example usage:

// Basic alert:
Ext.Msg.alert('Title', 'The quick brown fox jumped over the lazy dog.', Ext.emptyFn);

// Prompt for user data and process the result using a callback:
Ext.Msg.prompt('Name', 'Please enter your name:', function(text) {
    // process text value and close...
});

// Confirmation alert
Ext.Msg.confirm("Confirmation", "Are you sure you want to do that?", Ext.emptyFn);

Config Options

Config OptionsDefined By
 baseCls : String
The base CSS class to apply to this panel's element (defaults to 'x-panel').
Panel
 centered : Boolean
Center the Component. Defaults to false.
Component
 componentCls : String
Component's Base CSS class
MessageBox
 data : Mixed
The initial set of data to apply to the tpl to update the content area of the Component.
Component
 defaultTextHeight : Number
MessageBox
 disabled : Boolean
Defaults to false.
Component
 disabledCls : String
CSS class to add when the Component is disabled. Defaults to 'x-item-disabled'.
Component
 draggable : Boolean
Allows the component to be dragged via the touch event.
Component
 enter : String
The viewport side from which to anchor the sheet when made visible (top, bottom, left, right) Defaults to 'bottom'
Sheet
 enterAnimation : String/Mixed
effect when the message box is being displayed (defaults to 'pop')
MessageBox
 exitAnimation : String/Mixed
effect when the message box is being hidden (defaults to 'pop')
MessageBox
 floating : Boolean
Create the Component as a floating and use absolute positioning. Defaults to false.
Component
 floatingCls : Boolean
The class that is being added to this component when its floating. (defaults to x-floating)
Component
 height : Number
The height of this component in pixels.
Component
 hidden : Boolean
Defaults to false.
Component
 monitorOrientation : Boolean
Monitor Orientation change
Component
 stopMaskTapEvent : Boolean
True to stop the event that fires when you click outside the floating component. Defalts to true.
Component
 styleHtmlCls : String
The class that is added to the content target when you set styleHtmlContent to true. Defaults to 'x-html'
Component
 width : Number
The width of this component in pixels.
Component

Public Properties

PropertyDefined By
 draggable : Boolean
Read-only property indicating whether or not the component can be dragged
Component
 items : Ext.util.MixedCollection
The MixedCollection containing all the child items of this container.
Container
 rendered : Boolean
Read-only property indicating whether or not the component has been rendered.
Component

Public Methods

MethodDefined By

Public Events

EventDefined By