Clear Up
SharpKit Reference

Window Class

A specialized panel intended for use as an application window. Windows are floated, resizable, and draggable by default. Windows can be maximized to fill the viewport, restored to their prior size, and can be minimized.

Windows can also be linked to a Ext.ZIndexManager or managed by the Ext.WindowManager to provide grouping, activation, to front, to back and other application-specific behavior.

By default, Windows will be rendered to document.body. To constrain a Window to another element specify renderTo.

As with all Containers, it is important to consider how you want the Window to size and arrange any child Components. Choose an appropriate layout configuration which lays out child Components in the required manner.

  
    Ext.create('Ext.window.Window', {
            title: 'Hello',
            height: 200,
            width: 400,
            layout: 'fit',
            items: {  // Let's put an empty grid in just to illustrate fit layout
            xtype: 'grid',
            border: false,
            columns: [{header: 'World'}],                 // One header just for show. There's no data,
            store: Ext.create('Ext.data.ArrayStore', {}) // A dummy empty data store
            }
            }).show();
            

Namespace: Ext.window

Derived Types

Constructors

Fields

Name Description
animateTarget Id or element from which the window should animate while opening. Defaults to: null
constrain True to constrain the window within its containing element, false to allow it to fall outside of its containing element. By default the window will be rendered to document.body. To render and constrain the window within another element specify renderTo. Optionally the header only can be constrained using constrainHeader. Defaults to: false
constrainHeader True to constrain the window header within its containing element (allowing the window body to fall outside of its containing element) or false to allow the header to fall outside its containing element. Optionally the entire window can be constrained using constrain. Defaults to: false
constrainTo A Region (or an element from which a Region measurement will be read) which is used to constrain the window.
defaultFocus Specifies a Component to receive focus when this Window is focused. This may be one of:
  • The index of a footer Button.
  • The id or Ext.AbstractComponent.itemId of a descendant Component.
  • A Component.
  • expandOnShow True to always expand the window when it is displayed, false to keep it in its current state (which may be collapsed) when displayed. Defaults to: true
    maximizable True to display the 'maximize' tool button and allow the user to maximize the window, false to hide the button and disallow maximizing the window. Note that when a window is maximized, the tool button will automatically change to a 'restore' button with the appropriate behavior already built-in that will restore the window to its previous size. Defaults to: false
    maximized True to initially display the window in a maximized state. Defaults to: false
    minimizable True to display the 'minimize' tool button and allow the user to minimize the window, false to hide the button and disallow minimizing the window. Note that this button provides no implementation -- the behavior of minimizing a window is implementation-specific, so the minimize event must be handled and a custom minimize behavior implemented for this option to be useful. Defaults to: false
    modal True to make the window modal and mask everything behind it when displayed, false to display it without restricting access to other UI elements. Defaults to: false
    onEsc Allows override of the built-in processing for the escape key. Default action is to close the Window (performing whatever action is specified in closeAction. To prevent the Window closing when the escape key is pressed, specify this as Ext.emptyFn.
    plain True to render the window body with a transparent background so that it will blend into the framing elements, false to add a lighter background color to visually highlight the body element and separate it more distinctly from the surrounding frame. Defaults to: false
    x The X position of the left edge of the window on initial showing. Defaults to centering the Window within the width of the Window's container Element (The Element that the Window is rendered to).
    y The Y position of the top edge of the window on initial showing. Defaults to centering the Window within the height of the Window's container Element (The Element that the Window is rendered to).

    Methods

    Name Description
    getDefaultFocus() Gets the configured default focus item. If a defaultFocus is set, it will receive focus when the Window's focus method is called, otherwise the Window itself will receive focus.
    maximize() Fits the window within its current container and automatically replaces the 'maximize' tool button with the 'restore' tool button. Also see toggleMaximize.
    minimize() Placeholder method for minimizing the window. By default, this method simply fires the minimize event since the behavior of minimizing a window is application-specific. To implement custom minimize behavior, either the minimize event can be handled or this method can be overridden.
    restore() Restores a maximized window back to its original size and position prior to being maximized and also replaces the 'restore' tool button with the 'maximize' tool button. Also see toggleMaximize.
    toggleMaximize() A shortcut method for toggling between maximize and restore based on the current maximized state of the window.

    Properties

    Name Description
    isWindow true in this class to identify an object as an instantiated Window, or subclass thereof. Defaults to: true
    © Copyright 2005-2011 SharpKit. All rights reserved.