class ext.form.formpanel

139
Class Ext.form Class Ext.form.FormPanel Package : Ext.form Defined In: FormPane l.js Class: FormPane l Extends : Panel Simple form panel which enables easy getting and setting of field values. Can load model instances. Example usage: var form = new Ext.form.FormPanel({ items: [ { xtype: 'textfield' , name : 'first' , label : 'First name' }, { xtype: 'textfield' , name : 'last' , label : 'Last name' }, { xtype: 'numberfield' , name : 'age' , label : 'Age' }, { xtype: 'urlfield' , name : 'url' , label : 'Website' } ] }); Loading model instances: Ext.regModel( 'User' , { fields: [

Upload: xiztema

Post on 17-Oct-2014

93 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Class Ext.form.Formpanel

Class Ext.form Class Ext.form.FormPanel Package: Ext.formDefined In: FormPanel.jsClass: FormPanelExtends: Panel

Simple form panel which enables easy getting and setting of field values. Can load model instances. Example usage:

var form = new Ext.form.FormPanel({ items: [ { xtype: 'textfield' , name : 'first' , label : 'First name' }, { xtype: 'textfield' , name : 'last' , label : 'Last name' }, { xtype: 'numberfield' , name : 'age' , label : 'Age' }, { xtype: 'urlfield' , name : 'url' , label : 'Website' } ]});

Loading model instances:

Ext.regModel( 'User' , { fields: [ {name: 'first' , type: 'string' }, {name: 'last' , type: 'string' }, {name: 'age' , type: 'int' }, {name: 'url' , type: 'string' } ]});

var user = Ext.ModelMgr.create({ first: 'Ed' , last : 'Spencer' , age : 24, url : 'http://extjs.com' }, 'User' );

form.load(user);

Page 2: Class Ext.form.Formpanel

Config Options

Config OptionsDefined

By

 

activeItem : String/Number A string component id or the numeric index of the component that should be initially activated within the container's...A string component id or the numeric index of the component that should be initially activated within the container's layout on render. For example, activeItem: 'item-1' or activeItem: 0 (index 0 = the first item in the container's collection). activeItem only applies to layout styles that can display items one at a time (like Ext.layout.CardLayout and Ext.layout.FitLayout ). Related to Ext.layout.ContainerLayout.activeItem .

Container

 

autoDestroy : Boolean If true the container will automatically destroy any contained component that is removed from it, else destruction mu...If true the container will automatically destroy any contained component that is removed from it, else destruction must be handled manually (defaults to true).

Container

 baseCls : String The base CSS class to apply to this panel's element (defaults to 'x-panel' ).

Panel

 baseParams : Object Optional hash of params to be sent (when standardSubmit configuration is false) on every submit.

FormPanel

 

bodyBorder : Number/Boolean A shortcut for setting a border style on the body element. The value can either be a number to be applied to all side...A shortcut for setting a border style on the body element. The value can either be a number to be applied to all sides, or a normal css string describing borders. Defaults to undefined .

Panel

 

bodyMargin : Number/Boolean A shortcut for setting a margin style on the body element. The value can either be a number to be applied to all side...A shortcut for setting a margin style on the body element. The value can either be a number to be applied to all sides, or a normal css string describing margins. Defaults to undefined .

Panel

 

bodyPadding : Number/Boolean A shortcut for setting a padding style on the body element. The value can either be a number to be applied to all sid...A shortcut for setting a padding style on the body element. The value can either be a number to be applied to all sides, or a normal css string describing padding. Defaults to undefined .

Panel

 

border : Number/String Specifies the border for this component. The border can be a single numeric value to apply to all sides or it can be ...Specifies the border for this component. The border can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.

Component

 bubbleEvents : Array An array of events that, when fired, should be bubbled to any parent container. See

Container

Page 3: Class Ext.form.Formpanel

Ext.util.Observable.enableBubble....

An array of events that, when fired, should be bubbled to any parent container. See Ext.util.Observable.enableBubble . Defaults to [ 'add' , 'remove' ] .

 

cardSwitchAnimation : String/Mixed Animation to be used during transitions of cards. Note this only works when this container has a CardLayout. Any vali...Animation to be used during transitions of cards. Note this only works when this container has a CardLayout. Any valid value from Ext.anims can be used ('fade', 'slide', 'flip', 'cube', 'pop', 'wipe'). Defaults to null .

Container

 centered : Boolean Center the Component. Defaults to false.

Component

 

cls : String An optional extra CSS class that will be added to this component's Element (defaults to ''). This can be useful for ...An optional extra CSS class that will be added to this component's Element (defaults to ''). This can be useful for adding customized styles to the component or any of its children using standard CSS rules.

Component

 componentCls : String CSS Class to be added to a components root level element to give distinction to it via styling.

Component

 

componentLayout : String/Object The sizing and positioning of the component Elements is the responsibility of the Component's layout manager which cr...

The sizing and positioning of the component Elements is the responsibility of the Component's layout manager which creates and manages the type of layout specific to the component.

If the layout configuration is not explicitly specified for a general purpose compopnent the default layout manager will be used.

Component

 contentEl : String Optional. Specify an existing HTML element, or the id of an existing HTML element to use as the content for this comp...

Optional. Specify an existing HTML element, or the id of an existing HTML element to use as the content for this component.

Description :

This config option is used to take an existing HTML element and place it in the layout element of a new component (it simply moves the specified DOM element after the Component is rendered to use as the content.

Notes :

The specified HTML element is appended to the layout element of the component

Component

Page 4: Class Ext.form.Formpanel

after any configured HTML has been inserted , and so the document will not contain this element at the time the render event is fired.

The specified HTML element used will not participate in any layout scheme that the Component may use. It is just HTML. Layouts operate on child items .

Add either the x-hidden or the x-hide-display CSS class to prevent a brief flicker of the content before it is rendered to the panel.

 data : Mixed The initial set of data to apply to the tpl to update the content area of the Component.

Component

 

defaultType : String The default xtype of child Components to create in this Container when a child item is specified as a raw configurati...

The default xtype of child Components to create in this Container when a child item is specified as a raw configuration object, rather than as an instantiated Component.

Defaults to 'panel' .

Container

 defaults : Object|Function This option is a means of applying default settings to all added items whether added through the items config or via ...

This option is a means of applying default settings to all added items whether added through the items config or via the add or insert methods.

If an added item is a config object, and not an instantiated Component, then the default properties are unconditionally applied. If the added item is an instantiated Component, then the default properties are applied conditionally so as not to override existing properties in the item.

If the defaults option is specified as a function, then the function will be called using this Container as the scope ( this reference) and passing the added item as the first parameter. Any resulting object from that call is then applied to the item as default properties.

For example, to automatically apply padding to the body of each of a set of contained Ext.Panel items, you could pass: defaults: {bodyStyle: 'padding:15px' } .

Usage:

defaults: { // defaults are applied to items, not the container autoScroll:true},items: [ { xtype: 'panel' , // defaults do not have precedence over id: 'panel1' , // options in config objects, so the defaults autoScroll: false // will not be applied here, panel1 will be autoScroll:false

Container

Page 5: Class Ext.form.Formpanel

}, new Ext.Panel({ // defaults do have precedence over options id: 'panel2' , // options in components, so the defaults autoScroll: false // will be applied here, panel2 will be autoScroll:true. })]

 disabled : Boolean Defaults to false.

Component

 disabledCls : String CSS class to add when the Component is disabled. Defaults to 'x-item-disabled'.

Component

 

dockedItems : Object/Array A component or series of components to be added as docked items to this panel. The docked items can be docked to eith...A component or series of components to be added as docked items to this panel. The docked items can be docked to either the top, right, left or bottom of a panel. This is typically used for things like toolbars or tab bars: var panel = new Ext.Panel({ fullscreen: true, dockedItems: [{ xtype: 'toolbar' , dock: 'top' , items: [{ text: 'Docked to the bottom' }] }]});

Panel

 draggable : Boolean Allows the component to be dragged via the touch event.

Component

 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

 

fullscreen : Boolean Force the component to take up 100% width and height available. Defaults to false. Setting this configuration immedia...Force the component to take up 100% width and height available. Defaults to false. Setting this configuration immediately sets the monitorOrientation config to true. Setting this to true will render the component instantly.

Component

 height : Number The height of this component in pixels.

Component

 hidden : Boolean Defaults to false.

Component

 

hideOnMaskTap : Boolean True to automatically bind a tap listener to the mask that hides the window. Defaults to true. Note: if you set this ...True to automatically bind a tap listener to the mask that hides the window. Defaults to true. Note: if you set this property to false you have to programmaticaly hide the overlay.

Component

 html : String/Object An HTML fragment, or a DomHelper specification to use as the layout element content

Component

Page 6: Class Ext.form.Formpanel

(defaults to ''). The HTML conten...An HTML fragment, or a DomHelper specification to use as the layout element content (defaults to ''). The HTML content is added after the component is rendered, so the document will not contain this HTML at the time the render event is fired. This content is inserted into the body before any configured contentEl is appended.

 

items : Object/Array ** IMPORTANT: be sure to specify a layout if needed ! ** A single item, or an array of child Components to be added t...** IMPORTANT : be sure to specify a layout if needed ! **

A single item, or an array of child Components to be added to this container, for example:

// specifying a single itemitems: {...},layout: 'fit' , // specify a layout!

// specifying multiple itemsitems: [{...}, {...}],layout: 'hbox' , // specify a layout!

Each item may be:

any type of object based on Ext.Component a fully instanciated object or an object literal that:

o has a specified xtype o the Ext.Component.xtype specified is associated with the Component

desired and should be chosen from one of the available xtypes as listed in Ext.Component .

o If an xtype is not explicitly specified, the defaultType for that Container is used.

o will be "lazily instanciated", avoiding the overhead of constructing a fully instanciated Component object

Notes :

Ext uses lazy rendering. Child Components will only be rendered should it become necessary. Items are automatically laid out when they are first shown (no sizing is done while hidden), or in response to a doLayout call.

Do not specify contentEl / html with items .

Container

  layout : String/Object *Important: In order for child items to be correctly sized and positioned, typically a layout manager must be specifi...

*Important : In order for child items to be correctly sized and positioned, typically a layout manager must be specified through the layout configuration option.

Container

Page 7: Class Ext.form.Formpanel

The sizing and positioning of child items is the responsibility of the Container's layout manager which creates and manages the type of layout you have in mind. For example:

If the layout configuration is not explicitly specified for a general purpose container (e.g. Container or Panel) the default layout manager will be used which does nothing but render child components sequentially into the Container (no sizing or positioning will be performed in this situation).

layout may be specified as either as an Object or as a String:

Specify as an Object o Example usage:

layout: { type: 'vbox' , align: 'left' }

o type

The layout type to be used for this container. If not specified, a default Ext.layout.ContainerLayout will be created and used.

Valid layout type values are:

auto       Default card fit hbox vbox

o Layout specific configuration properties

Additional layout specific configuration properties may also be specified. For complete details regarding the valid config options for each layout type, see the layout class corresponding to the type specified.

Specify as a String o Example usage:

layout: { type: 'vbox' ,

Page 8: Class Ext.form.Formpanel

padding: '5' , align: 'left' }

o layout

The layout type to be used for this container (see list of valid layout type values above).

Additional layout specific configuration properties. For complete details regarding the valid config options for each layout type, see the layout class corresponding to the layout specified.

 

layoutOnOrientationChange : Boolean Set this to true to automatically relayout this component on orientation change. This property is set to true by defa...Set this to true to automatically relayout this component on orientation change. This property is set to true by default if a component is floating unless you specifically set this to false. Also note that you dont have to set this property to true if this component is a child of a fullscreen container, since fullscreen components are also laid out automatically on orientation change. Defaults to null

Component

  listeners : Object A config object containing one or more event handlers to be added to this object during initialization. This should ...

A config object containing one or more event handlers to be added to this object during initialization. This should be a valid listeners config object as specified in the addListener example for attaching multiple handlers at once.

DOM events from ExtJs Components

While some ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this is usually only done when extra value can be added. For example the DataView 's click event passing the node clicked on. To access DOM events directly from a child element of a Component, we need to specify the element option to identify the Component property to add a DOM listener to:

new Ext.Panel({ width: 400, height: 200, dockedItems: [{ xtype: 'toolbar' }],

Observable

Page 9: Class Ext.form.Formpanel

listeners: { click: { element: 'el' , //bind to the underlying el property on the panel fn: function (){ console.log( 'click el' ); } }, dblclick: { element: 'body' , //bind to the underlying body property on the panel fn: function (){ console.log( 'dblclick body' ); } } }});

 

margin : Number/String Specifies the margin for this component. The margin can be a single numeric value to apply to all sides or it can be ...Specifies the margin for this component. The margin can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.

Component

 

maxHeight : Number The maximum value in pixels which this Component will set its height to. Warning: This will override any size managem...

The maximum value in pixels which this Component will set its height to.

Warning: This will override any size management applied by layout managers.

Component

 

maxWidth : Number The maximum value in pixels which this Component will set its width to. Warning: This will override any size manageme...

The maximum value in pixels which this Component will set its width to.

Warning: This will override any size management applied by layout managers.

Component

 

minHeight : Number The minimum value in pixels which this Component will set its height to. Warning: This will override any size managem...

The minimum value in pixels which this Component will set its height to.

Warning: This will override any size management applied by layout managers.

Component

 

minWidth : Number The minimum value in pixels which this Component will set its width to. Warning: This will override any size manageme...

The minimum value in pixels which this Component will set its width to.

Warning: This will override any size management applied by layout managers.

Component

 modal : Boolean True to make the Component modal and mask everything behind it when displayed, false to display it without restrictin...

Component

Page 10: Class Ext.form.Formpanel

True to make the Component modal and mask everything behind it when displayed, false to display it without restricting access to other UI elements (defaults to false).

 monitorOrientation : Boolean Monitor Orientation change

Component

 

padding : Number/String Specifies the padding for this component. The padding can be a single numeric value to apply to all sides or it can b...Specifies the padding for this component. The padding can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.

Component

 

plugins : Object/Array An object or array of objects that will provide custom functionality for this component. The only requirement for a ...An object or array of objects that will provide custom functionality for this component. The only requirement for a valid plugin is that it contain an init method that accepts a reference of type Ext.Component. When a component is created, if any plugins are available, the component will call the init method on each plugin, passing a reference to itself. Each plugin can then call methods or respond to events on the component as needed to provide its functionality.

Component

 

renderSelectors. : Object An object containing properties specifying DomQuery selectors which identify child elements created by the render pro...

An object containing properties specifying DomQuery selectors which identify child elements created by the render process.

After the Component's internal structure is rendered according to the renderTpl , this object is iterated through, and the found Elements are added as properties to the Component using the renderSelector property name.

For example, a Component which rendered an image, and description into its element might use the following properties coded into its prototype:

renderTpl: ' "{imageUrl}" class= "x-image-component-img" > "x-image-component-desc">{description}',

renderSelectors: { image: 'img.x-image-component-img' , descEl: 'div.x-image-component-desc' }

After rendering, the Component would have a property image referencing its child img Element, and a property descEl referencing the div Element which contains the description.

Component

 renderTo : Mixed Specify the id of the element, a DOM element or an existing Element that this component will be rendered into. Notes ...

Component

Page 11: Class Ext.form.Formpanel

Specify the id of the element, a DOM element or an existing Element that this component will be rendered into.

Notes :

Do not use this option if the Component is to be a child item of a Container . It is the responsibility of the Container 's layout manager to render and manage its child items.

When using this config, a call to render() is not required.

See render also.

 

renderTpl : Mixed An XTemplate used to create the internal structure inside this Component's encapsulating Element. You do not normally...

An XTemplate used to create the internal structure inside this Component's encapsulating Element .

You do not normally need to specify this. For the base classes Ext.Component and Ext.Container , this defaults to null which means that they will be initially rendered with no internal structure; they render their Element empty. The more specialized ExtJS and Touch classes which use a more complex DOM structure, provide their own template definitions.

This is intended to allow the developer to create application-specific utility Components with customized internal structure.

Upon rendering, any created child elements may be automatically imported into object properties using the renderSelectors option.

Component

 

scroll : Mixed Configure the component to be scrollable. Acceptable values are: 'horizontal', 'vertical', 'both' to enabling scroll...Configure the component to be scrollable. Acceptable values are:

'horizontal', 'vertical', 'both' to enabling scrolling for that direction. A Scroller configuration. false to explicitly disable scrolling.

Enabling scrolling immediately sets the monitorOrientation config to true (for Panel )

Component

 

showAnimation : Object/String/Boolean The type of animation you want to use when this component is shown. If you set this this hide animation will automati...The type of animation you want to use when this component is shown. If you set this this hide animation will automatically be the opposite.

Component

 standardSubmit : Boolean Wether or not we want to perform a standard form submit. Defaults to false

FormPanel

Page 12: Class Ext.form.Formpanel

 stopMaskTapEvent : Boolean True to stop the event that fires when you click outside the floating component. Defalts to true.

Component

 

style : String A custom style specification to be applied to this component's Element. Should be a valid argument to Ext.Element.ap...A custom style specification to be applied to this component's Element. Should be a valid argument to Ext.Element.applyStyles . new Ext.Panel({ title: 'Some Title' , renderTo: Ext.getBody(), width: 400, height: 300, layout: 'form' , items: [{ xtype: 'textareafield' , style: { width: '95%' , marginBottom: '10px' } }, new Ext.Button({ text: 'Send' , minWidth: '100' , style: { marginBottom: '10px' } }) ] });

Component

 styleHtmlCls : String The class that is added to the content target when you set styleHtmlContent to true. Defaults to 'x-html'

Component

 

styleHtmlContent : String True to automatically style the html inside the content target of this component (body for panels). Defaults to false...True to automatically style the html inside the content target of this component (body for panels). Defaults to false.

Component

 

submitOnAction : Object When this is set to true, the form will automatically submit itself whenever the 'action' event fires on a field in t...When this is set to true, the form will automatically submit itself whenever the 'action' event fires on a field in this form. The action event usually fires whenever you press go or enter inside a textfield.

FormPanel

 

tpl : Mixed An Ext.Template, Ext.XTemplate or an array of strings to form an Ext.XTemplate. Used in conjunction with the data and...An Ext.Template , Ext.XTemplate or an array of strings to form an Ext.XTemplate. Used in conjunction with the data and tplWriteMode configurations.

Component

  tplWriteMode : String The Ext.(X)Template method to use when updating the content area of the Component. Defaults to 'overwrite' (see Ext.X...The Ext.(X)Template method to use when updating the content area of the Component.

Component

Page 13: Class Ext.form.Formpanel

Defaults to 'overwrite' (see Ext.XTemplate.overwrite ).

 

ui : String A set of predefined ui styles for individual components. Most components support 'light' and 'dark'. Extra string add...A set of predefined ui styles for individual components. Most components support 'light' and 'dark'. Extra string added to the baseCls with an extra '-'. new Ext.Panel({ title: 'Some Title' , baseCls: 'x-component' ui: 'green' });

The ui configuration in this example would add 'x-component-green' as an additional class.

Component

 url : String The default Url for submit actions

FormPanel

 

waitTpl : Object The defined waitMsg template. Used for precise control over the masking agent used to mask the FormPanel (or other E...The defined waitMsg template. Used for precise control over the masking agent used to mask the FormPanel (or other Element) during form Ajax/submission actions. For more options, see showMask method.

FormPanel

 width : Number The width of this component in pixels.

Component

Public Properties

Property Defined 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

 record : Ext.data.Model The Model instance currently loaded into this form (if any). Read only

FormPanel

 rendered : Boolean Read-only property indicating whether or not the component has been rendered.

Component

Public Methods

MethodDefined

By add (   ...Object/Array   component   ) : Ext.Component/Array Adds Component(s) to this Container. Description : <ul class="mdetail-params"> Fires the beforeadd event before addin...

Adds Component (s) to this Container.

Container

Page 14: Class Ext.form.Formpanel

Description :

Fires the beforeadd event before adding The Container's default config values will be applied accordingly (see defaults for

details). Fires the add event after the component has been added.

Notes :

If the Container is already rendered when add is called, you may need to call doLayout to refresh the view which causes any unrendered child Components to be rendered. This is required so that you can add multiple child components if needed while only refreshing the layout once. For example:

var tb = new Ext.Toolbar (); tb.render(document.body); // toolbar is rendered tb.add({text: 'Button 1' }); // add multiple items ( defaultType for

Toolbar is 'button' ) tb.add({text: 'Button 2' });

tb. doLayout (); // refresh the layout

Warning: Containers directly managed by the BorderLayout layout manager may not be removed or added. See the Notes for BorderLayout for more details.

Parameters:

component : ...Object/Array

Either one or more Components to add or an Array of Components to add. See items for additional information.

Returns:

Ext.Component/Array

The Components that were added. addCls () : void Adds a CSS class to the top level element representing this component.Adds a CSS class to the top level element representing this component.Parameters:

None.

Returns:

Component

Page 15: Class Ext.form.Formpanel

void

 

addDocked (   Object/Array   component. ,   [ Number   pos ]   ) : void Adds docked item(s) to the panel.Adds docked item(s) to the panel.Parameters:

component. : Object/Array

The Component or array of components to add. The components must include a 'dock' paramater on each component to indicate where it should be docked ('top', 'right', 'bottom', 'left').

pos : Number

(optional) The index at which the Component will be added

Returns:

void

Panel

 

addEvents (   Object|String   o ,   string   Optional.   ) : void Adds the specified events to the list of events which this Observable may fire.Adds the specified events to the list of events which this Observable may fire.Parameters:

o : Object|String

Either an object with event names as properties with a value of true or the first event name string if multiple event names are being passed as separate parameters.

Optional. : string

Event name if multiple event names are being passed as separate parameters. Usage:

this.addEvents( 'storeloaded' , 'storecleared' );

Returns:

void

Observable

 addListener (   String   eventName ,   Function   handler ,   [ Object   scope ],   [ Object   options ]   ) : voidAppends an event handler to this object.Appends an event handler to this object.Parameters:

Observable

Page 16: Class Ext.form.Formpanel

eventName : String

The name of the event to listen for. May also be an object who's property names are event names. See

handler : Function

The method the event invokes.

scope : Object

(optional) The scope ( this reference) in which the handler function is executed. If omitted, defaults to the object which fired the event.

options : Object

(optional) An object containing handler configuration. properties. This may contain any of the following properties:

o scope : Object

The scope ( this reference) in which the handler function is executed. If omitted, defaults to the object which fired the event.

o delay : Number

The number of milliseconds to delay the invocation of the handler after the event fires.

o single : Boolean

True to add a handler to handle just the next firing of the event, and then remove itself.

o buffer : Number

Causes the handler to be scheduled to run in an Ext.util.DelayedTask delayed by the specified number of milliseconds. If the event fires again within that time, the original handler is not invoked, but the new handler is scheduled in its place.

o target : Observable

Only call the handler if the event was fired on the target Observable, not if the event was bubbled up from a child Observable.

Page 17: Class Ext.form.Formpanel

o element : String

This option is only valid for listeners bound to Components . The name of a Component property which references an element to add a listener to.

This option is useful during Component construction to add DOM event listeners to elements of Components which will exist only after the Component is rendered. For example, to add a click listener to a Panel's body:

new Ext.Panel({ title: 'The title' , listeners: { click: this.handlePanelClick, element: 'body' }});

When added in this way, the options available are the options applicable to Ext.Element.addListener

Combining OptionsUsing the options argument, it is possible to combine different types of listeners:

A delayed, one-time listener.

myPanel.on( 'hide' , this.handleClick, this, { single: true,delay: 100});

Attaching multiple handlers in 1 callThe method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:

myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution});

.

Returns:

void

Page 18: Class Ext.form.Formpanel

 

addManagedListener (   Observable|Element   item ,   Object|String   ename ,   Function   fn ,   Object   scope ,   Object   opt   ) : void Adds listeners to any Observable object (or Element) which are automatically removed when this Component is destroyed...

Adds listeners to any Observable object (or Element) which are automatically removed when this Component is destroyed.

Parameters:

item : Observable|Element

The item to which to add a listener/listeners.

ename : Object|String

The event name, or an object containing event name properties.

fn : Function

Optional. If the ename parameter was an event name, this is the handler function.

scope : Object

Optional. If the ename parameter was an event name, this is the scope ( this reference) in which the handler function is executed.

opt : Object

Optional. If the ename parameter was an event name, this is the addListener options.

Returns:

void

Observable

 child (   String   selector   ) : Ext.Component Retrieves the first direct child of this container which matches the passed selector. The passed in selector must com...Retrieves the first direct child of this container which matches the passed selector. The passed in selector must comply with an Ext.ComponentQuery selector.Parameters:

selector : String

An Ext.ComponentQuery selector

Returns:

Container

Page 19: Class Ext.form.Formpanel

Ext.Component

 

clearListeners () : void Removes all listeners for this object including the managed listenersRemoves all listeners for this object including the managed listenersParameters:

None.

Returns:

void

Observable

 

clearManagedListeners () : void Removes all managed listeners for this object.Removes all managed listeners for this object.Parameters:

None.

Returns:

void

Observable

 

destroy () : void Destroys the Component.Destroys the Component.Parameters:

None.

Returns:

void

Component

 

disable () : Ext.form.FormPanel A convenient method to disable all fields in this formsA convenient method to disable all fields in this formsParameters:

None.

Returns:

Ext.form.FormPanel

this This form

FormPanel

Page 20: Class Ext.form.Formpanel

 

doComponentLayout () : Ext.Container This method needs to be called whenever you change something on this component that requires the components layout to...This method needs to be called whenever you change something on this component that requires the components layout to be recalculated. An example is adding, showing or hiding a docked item to a Panel, or changing the label of a form field. After a component layout, the container layout will automatically be run. So you could be on the safe side and always call doComponentLayout instead of doLayout.Parameters:

None.

Returns:

Ext.Container

this

Component

 

doLayout () : Ext.Container Force this container's layout to be recalculated. A call to this function is required after adding a new component to...Force this container's layout to be recalculated. A call to this function is required after adding a new component to an already rendered container, or possibly after changing sizing/position properties of child components.Parameters:

None.

Returns:

Ext.Container

this

Container

 

down (   String   selector   ) : Ext.Component Retrieves the first descendant of this container which matches the passed selector. The passed in selector must compl...Retrieves the first descendant of this container which matches the passed selector. The passed in selector must comply with an Ext.ComponentQuery selector.Parameters:

selector : String

An Ext.ComponentQuery selector

Returns:

Ext.Component

Container

 enable () : Ext.form.FormPanel A convenient method to enable all fields in this forms

FormPanel

Page 21: Class Ext.form.Formpanel

A convenient method to enable all fields in this formsParameters:

None.

Returns:

Ext.form.FormPanel

this This form enableBubble (   String/Array   events   ) : void Enables events fired by this Observable to bubble up an owner hierarchy by calling this.getBubbleTarget() if present....

Enables events fired by this Observable to bubble up an owner hierarchy by calling this.getBubbleTarget() if present. There is no implementation in the Observable base class.

This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget . The default implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.

Example:

Ext.override(Ext.form.Field, {// Add functionality to Field's initComponent to enable the change event to bubbleinitComponent : Ext.createSequence(Ext.form.Field.prototype.initComponent, function () { this.enableBubble( 'change' ); }),

// We know that we want Field's events to bubble directly to the FormPanel.getBubbleTarget : function () { if (!this.formPanel) { this.formPanel = this.findParentByType( 'form' ); } return this.formPanel; }});

var myForm = new Ext.formPanel({ title: 'User Details' , items: [{ ...}],listeners: { change: function () { // Title goes red if form has been modified. myForm.header.setStyle( 'color' , 'red' ); }}

Observable

Page 22: Class Ext.form.Formpanel

});

Parameters:

events : String/Array

The event name to bubble, or an Array of event names.

Returns:

void

 

fireEvent (   String   eventName ,   Object...   args   ) : Boolean Fires the specified event with the passed parameters (minus the event name). An event may be set to bubble up an Obse...

Fires the specified event with the passed parameters (minus the event name).

An event may be set to bubble up an Observable parent hierarchy (See Ext.Component.getBubbleTarget ) by calling enableBubble .

Parameters:

eventName : String

The name of the event to fire.

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.

Observable

 

getActiveItem () : activeItem Returns the current activeItem for the layout (only for a card layout)Returns the current activeItem for the layout (only for a card layout)Parameters:

None.

Returns:

activeItem

activeItem Current active component

Container

 getBubbleTarget () : Ext.Container Compon

Page 23: Class Ext.form.Formpanel

Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.Parameters:

None.

Returns:

Ext.Container

the Container which owns this Component.

ent

 

getComponent (   String/Number   comp   ) : Ext.Component Attempts a default component lookup (see Ext.Container.getComponent). If the component is not found in the normal ite...Attempts a default component lookup (see Ext.Container.getComponent ). If the component is not found in the normal items, the dockedItems are searched and the matched component (if any) returned (see {@loink #getDockedComponent}).Parameters:

comp : String/Number

The docked component id or itemId to find

Returns:

Ext.Component

The docked component, if found

Panel

 

getDockedComponent (   String/Number   comp   ) : Ext.Component Finds a docked component by id, itemId or positionFinds a docked component by id, itemId or positionParameters:

comp : String/Number

The id, itemId or position of the child component (see getComponent for details)

Returns:

Ext.Component

The component (if found)

Panel

 getDockedItems () : Array Retrieve an array of all currently docked components.Retrieve an array of all currently docked components.Parameters:

Panel

Page 24: Class Ext.form.Formpanel

None.

Returns:

Array

An array of components.

 

getEl () : void Retrieves the top level element representing this component.Retrieves the top level element representing this component.Parameters:

None.

Returns:

void

Component

 

getHeight () : Number Gets the current height of the component's underlying element.Gets the current height of the component's underlying element.Parameters:

None.

Returns:

Number

Component

 

getId () : void Retrieves the id of this component. Will autogenerate an id if one has not already been set.Retrieves the id of this component. Will autogenerate an id if one has not already been set.Parameters:

None.

Returns:

void

Component

 getInsertPosition (   String/Number/Element/HTMLElement   position   ) : HTMLElement This function takes the position argument passed to onRender and returns a DOM element that you can use in the insert...This function takes the position argument passed to onRender and returns a DOM element that you can use in the insertBefore.Parameters:

Component

Page 25: Class Ext.form.Formpanel

position : String/Number/Element/HTMLElement

Index, element id or element you want to put this component before.

Returns:

HTMLElement

DOM element that you can use in the insertBefore

 

getLayout () : Ext.layout.ContainerLayout Returns the layout instance currently associated with this Container. If a layout has not been instantiated yet, that...Returns the layout instance currently associated with this Container. If a layout has not been instantiated yet, that is done firstParameters:

None.

Returns:

Ext.layout.ContainerLayout

The layout

Container

 

getRecord () : Ext.data.Model Returns the Model instance currently loaded into this form (if any)Returns the Model instance currently loaded into this form (if any)Parameters:

None.

Returns:

Ext.data.Model

The Model instance

FormPanel

 

getSize () : Object Gets the current size of the component's underlying element.Gets the current size of the component's underlying element.Parameters:

None.

Returns:

Object

An object containing the element's size {width: (element width), height: (element height)}

Component

Page 26: Class Ext.form.Formpanel

 

getValues (   Boolean   enabled   ) : Object Returns an object containing the value of each field in the form, keyed to the field's name. For groups of checkbox ...Returns an object containing the value of each field in the form, keyed to the field's name. For groups of checkbox fields with the same name, it will be arrays of values. For examples: { name: "Jacky Nguyen" , // From a TextField favorites: [ 'pizza' , 'noodle' , 'cake' ] }

Parameters:

enabled : Boolean

true to return only enabled fields

Returns:

Object

Object mapping field name to its value

FormPanel

 

getWidth () : Number Gets the current width of the component's underlying element.Gets the current width of the component's underlying element.Parameters:

None.

Returns:

Number

Component

 getXTypes () : String Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the Ext...

Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the Ext.Component header.

If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.

Example usage:

var t = new Ext.form.Text(); alert(t.getXTypes()); // alerts 'component/field/textfield'

Parameters:

Component

Page 27: Class Ext.form.Formpanel

None.

Returns:

String

The xtype hierarchy string

 

hasListener (   String   eventName   ) : Boolean Checks to see if this object has any listeners for a specified eventChecks to see if this object has any listeners for a specified eventParameters:

eventName : String

The name of the event to check for

Returns:

Boolean

True if the event is being listened for, else false

Observable

 

hide (   [ Object/String/Boolean   animation ]   ) : void Hide the componentHide the componentParameters:

animation : Object/String/Boolean

(optional) Defaults to false.

Returns:

void

Component

 

hideMask () : Ext.form.FormPanel Hides a previously shown wait mask (See showMask)Hides a previously shown wait mask (See showMask ) Parameters:

None.

Returns:

Ext.form.FormPanel

this

FormPanel

 insert (   Number   index ,   Ext.Component   component   ) : Ext.Component Contain

Page 28: Class Ext.form.Formpanel

Inserts a Component into this Container at a specified index. Fires the beforeadd event before inserting, then fires ...Inserts a Component into this Container at a specified index. Fires the beforeadd event before inserting, then fires the add event after the Component has been inserted. Parameters:

index : Number

The index at which the Component will be inserted into the Container's items collection

component : Ext.Component

The child Component to insert.

Ext uses lazy rendering, and will only render the inserted Component should it become necessary.

A Component config object may be passed in order to avoid the overhead of constructing a real Component object if lazy rendering might mean that the inserted Component will not be rendered immediately. To take advantage of this 'lazy instantiation', set the Ext.Component.xtype config property to the registered type of the Component wanted.

For a list of all available xtypes, see Ext.Component .

Returns:

Ext.Component

component The Component (or config object) that was inserted with the Container's default config values applied.

er

 insertDocked (   Number   pos ,   Object/Array   component.   ) : void Inserts docked item(s) to the panel at the indicated position.Inserts docked item(s) to the panel at the indicated position.Parameters:

pos : Number

The index at which the Component will be inserted

component. : Object/Array

The Component or array of components to add. The components must include a 'dock' paramater on each component to indicate where it should be docked ('top', 'right', 'bottom', 'left').

Returns:

Panel

Page 29: Class Ext.form.Formpanel

void

 

isDisabled () : Boolean Method to determine whether this Component is currently disabled.Method to determine whether this Component is currently disabled.Parameters:

None.

Returns:

Boolean

the disabled state of this Component.

Component

 

isDraggable () : Boolean Method to determine whether this Component is draggable.Method to determine whether this Component is draggable.Parameters:

None.

Returns:

Boolean

the draggable state of this component.

Component

 

isDroppable () : Boolean Method to determine whether this Component is droppable.Method to determine whether this Component is droppable.Parameters:

None.

Returns:

Boolean

the droppable state of this component.

Component

 isFloating () : Boolean Method to determine whether this Component is floating.Method to determine whether this Component is floating.Parameters:

None.

Returns:

Component

Page 30: Class Ext.form.Formpanel

Boolean

the floating state of this component.

 

isHidden () : Boolean Method to determine whether this Component is currently set to hidden.Method to determine whether this Component is currently set to hidden.Parameters:

None.

Returns:

Boolean

the hidden state of this Component.

Component

 

isVisible () : Boolean Returns true if this component is visible.Returns true if this component is visible.Parameters:

None.

Returns:

Boolean

True if this component is visible, false otherwise.

Component

 isXType (   String   xtype ,   [ Boolean   shallow ]   ) : Boolean Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from th...

Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from the xtype (default) or whether it is directly of the xtype specified (shallow = true).

If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.

For a list of all available xtypes, see the Ext.Component header.

Example usage:

var t = new Ext.form.Text(); var isText = t.isXType( 'textfield' ); // true var isBoxSubclass = t.isXType( 'field' ); // true, descended from Ext.form.Fieldvar isBoxInstance = t.isXType( 'field' , true); // false, not a direct Ext.form.Field instance

Parameters:

Component

Page 31: Class Ext.form.Formpanel

xtype : String

The xtype to check for this Component

shallow : Boolean

(optional) False to check whether this Component is descended from the xtype (this is the default), or true to check whether this Component is directly of the specified xtype.

Returns:

Boolean

True if this component descends from the specified xtype, false otherwise.

 

load (   Ext.data.Model   instance   ) : Ext.form.FormPanel (Shortcut to loadRecord method) Loads matching fields from a model instance into this form(Shortcut to loadRecord method) Loads matching fields from a model instance into this form Parameters:

instance : Ext.data.Model

The model instance

Returns:

Ext.form.FormPanel

this

FormPanel

 

loadRecord (   Ext.data.Model   instance   ) : Ext.form.FormPanel Loads matching fields from a model instance into this formLoads matching fields from a model instance into this formParameters:

instance : Ext.data.Model

The model instance

Returns:

Ext.form.FormPanel

this

FormPanel

 nextSibling (   selector   Optional.   ) : void Returns the next sibling of this Component. Optionally selects the next sibling which matches the passed ComponentQue...

Component

Page 32: Class Ext.form.Formpanel

Returns the next sibling of this Component.

Optionally selects the next sibling which matches the passed ComponentQuery selector.

May also be refered to as prev()

Parameters:

Optional. : selector

A ComponentQuery selector to filter the following items.

Returns:

void

 

on (   String   eventName ,   Function   handler ,   [ Object   scope ],   [ Object   options ]   ) : void Appends an event handler to this object (shorthand for addListener.)Appends an event handler to this object (shorthand for addListener .) Parameters:

eventName : String

The type of event to listen for

handler : Function

The method the event invokes

scope : Object

(optional) The scope ( this reference) in which the handler function is executed. If omitted, defaults to the object which fired the event.

options : Object

(optional) An object containing handler configuration.

Returns:

void

Observable

 previousSibling (   selector   Optional.   ) : void Returns the previous sibling of this Component. Optionally selects the previous sibling which matches the passed Comp...

Component

Page 33: Class Ext.form.Formpanel

Returns the previous sibling of this Component.

Optionally selects the previous sibling which matches the passed ComponentQuery selector.

May also be refered to as prev()

Parameters:

Optional. : selector

A ComponentQuery selector to filter the preceding items.

Returns:

void

 

query (   String   selector   ) : Array Retrieves all descendant components which match the passed selector. Executes an Ext.ComponentQuery.query using this ...Retrieves all descendant components which match the passed selector. Executes an Ext.ComponentQuery.query using this container as its root.Parameters:

selector : String

Selector complying to an Ext.ComponentQuery selector

Returns:

Array

Ext.Component's which matched the selector

Container

 relayEvents (   Object   o ,   Array   events   ) : void Relays selected events from the specified Observable as if the events were fired by this.Relays selected events from the specified Observable as if the events were fired by this . Parameters:

o : Object

The Observable whose events this object is to relay.

events : Array

Array of event names to relay.

Returns:

Observable

Page 34: Class Ext.form.Formpanel

void

 

remove (   Component/String   component ,   [ Boolean   autoDestroy ]   ) : Ext.Component Removes a component from this container. Fires the beforeremove event before removing, then fires the remove event a...Removes a component from this container. Fires the beforeremove event before removing, then fires the remove event after the component has been removed. Parameters:

component : Component/String

The component reference or id to remove.

autoDestroy : Boolean

(optional) True to automatically invoke the removed Component's Ext.Component.destroy function. Defaults to the value of this Container's autoDestroy config.

Returns:

Ext.Component

component The Component that was removed.

Container

 

removeAll (   [ Boolean   autoDestroy ]   ) : Array Removes all components from this container.Removes all components from this container.Parameters:

autoDestroy : Boolean

(optional) True to automatically invoke the removed Component's Ext.Component.destroy function. Defaults to the value of this Container's autoDestroy config.

Returns:

Array

Array of the destroyed components

Container

 removeCls () : void Removes a CSS class from the top level element representing this component.Removes a CSS class from the top level element representing this component.Parameters:

None.

Component

Page 35: Class Ext.form.Formpanel

Returns:

void

 

removeDocked (   Ext.Component   item. ,   [ Boolean   autoDestroy ]   ) : void Removes the docked item from the panel.Removes the docked item from the panel.Parameters:

item. : Ext.Component

The Component to remove.

autoDestroy : Boolean

(optional) Destroy the component after removal.

Returns:

void

Panel

 

removeListener (   String   eventName ,   Function   handler ,   [ Object   scope ]   ) : void Removes an event handler.Removes an event handler.Parameters:

eventName : String

The type of event the handler was associated with.

handler : Function

The handler to remove. This must be a reference to the function passed into the addListener call.

scope : Object

(optional) The scope originally specified for the handler.

Returns:

void

Observable

 removeManagedListener (   Observable|Element   item ,   Object|String   ename ,   Function   fn ,   Object   scope   ) : void Removes listeners that were added by the mon method.Removes listeners that were added by the mon method. Parameters:

Observable

Page 36: Class Ext.form.Formpanel

item : Observable|Element

The item from which to remove a listener/listeners.

ename : Object|String

The event name, or an object containing event name properties.

fn : Function

Optional. If the ename parameter was an event name, this is the handler function.

scope : Object

Optional. If the ename parameter was an event name, this is the scope ( this reference) in which the handler function is executed.

Returns:

void

 

reset () : Ext.form.FormPanel Resets all fields in the form back to their original valuesResets all fields in the form back to their original valuesParameters:

None.

Returns:

Ext.form.FormPanel

this This form

FormPanel

 

resumeEvents () : void Resume firing events. (see suspendEvents) If events were suspended using the queueSuspended parameter, then all event...Resume firing events. (see suspendEvents ) If events were suspended using the queueSuspended parameter, then all events fired during event suspension will be sent to any listeners now.Parameters:

None.

Returns:

void

Observable

Page 37: Class Ext.form.Formpanel

 

setActiveItem (   Ext.Component/Number/Object   card ,   [ String/Object   cardSwitchAnim ation ]   ) : Ext.Container Allows you to set the active card in this container. This method is only available if the container uses a CardLayout...Allows you to set the active card in this container. This method is only available if the container uses a CardLayout. Note that a Carousel and TabPanel both get a CardLayout automatically, so both of those components are able to use this method.Parameters:

card : Ext.Component/Number/Object

The card you want to be made active. A number is interpreted as a card index. An object will be converted to a Component using the objects xtype property, then added to the container and made active. Passing a Component will make sure the component is a child of this container, and then make it active.

cardSwitchAnimation : String/Object

(optional) The cardSwitchAnimation used to switch between the cards. This can be an animation type string or an animation configuration object.

Returns:

Ext.Container

this

Container

 

setCentered (   Boolean   centered   ) : void Show this component centered of its parent or the window This only applies when the component is floating.Show this component centered of its parent or the window This only applies when the component is floating.Parameters:

centered : Boolean

True to center, false to remove centering

Returns:

void

Component

 setDisabled (   Boolean   disabled   ) : void Enable or disable the component.Enable or disable the component.Parameters:

disabled : Boolean

Component

Page 38: Class Ext.form.Formpanel

Returns:

void

 

setDocked () : Component Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of ...Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)Parameters:

None.

Returns:

Component

this

Component

 

setDraggable (   Boolean/Mixed   draggable ,   Boolean   autoShow   ) : void Sets a Component as draggable.Sets a Component as draggable.Parameters:

draggable : Boolean/Mixed

On first call, this can be a config object for Ext.util.Draggable . Afterwards, if set to false, the existing draggable object will be disabled

autoShow : Boolean

Returns:

void

Component

 

setFloating (   Boolean   floating ,   Boolean   autoShow   ) : void Sets a Component as floating.Sets a Component as floating.Parameters:

floating : Boolean autoShow : Boolean

Returns:

void

Component

 setHeight (   Number   height   ) : Ext.Component Compon

Page 39: Class Ext.form.Formpanel

Sets the height of the component. This method fires the resize event.Sets the height of the component. This method fires the resize event. Parameters:

height : Number

The new height to set. This may be one of:

o A Number specifying the new height in the Element 's Ext.Element.defaultUnit s (by default, pixels).

o A String used to set the CSS height style. o undefined to leave the height unchanged.

Returns:

Ext.Component

this

ent

 

setLoading (   Boolean/Object   load ,   Boolean   targetEl   ) : Ext.LoadMask This method allows you to show or hide a LoadMask on top of this component.This method allows you to show or hide a LoadMask on top of this component.Parameters:

load : Boolean/Object

True to show the default LoadMask or a config object that will be passed to the LoadMask constructor. False to hide the current LoadMask.

targetEl : Boolean

True to mask the targetEl of this Component instead of the this.el. For example, setting this to true on a Panel will cause only the body to be masked. (defaults to false)

Returns:

Ext.LoadMask

The LoadMask instance that has just been shown.

Component

 setOrientation (   String   orientation ,   Number/String   width ,   Number/String   height   ) : voidSets the orientation for the Panel.Sets the orientation for the Panel.Parameters:

orientation : String

Component

Page 40: Class Ext.form.Formpanel

'landscape' or 'portrait'

width : Number/String

New width of the Panel.

height : Number/String

New height of the Panel.

Returns:

void

 

setPosition (   Number   left ,   Number   top   ) : Ext.Component Sets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires ...Sets the left and top of the component. To set the page XY position instead, use setPagePosition . This method fires the move event. Parameters:

left : Number

The new left

top : Number

The new top

Returns:

Ext.Component

this

Component

 setScrollable (   Mixed   config   ) : void Sets a Component as scrollable.Sets a Component as scrollable.Parameters:

config : Mixed

Acceptable values are a Ext.Scroller configuration, 'horizontal', 'vertical', 'both', and false

Returns:

Component

Page 41: Class Ext.form.Formpanel

void

 

setSize (   Mixed   width ,   Mixed   height   ) : Ext.Component Sets the width and height of this Component. This method fires the resize event. This method can accept either width ...Sets the width and height of this Component. This method fires the resize event. This method can accept either width and height as separate arguments, or you can pass a size object like {width:10, height:20} . Parameters:

width : Mixed

The new width to set. This may be one of:

o A Number specifying the new width in the Element 's Ext.Element.defaultUnit s (by default, pixels).

o A String used to set the CSS width style. o A size object in the format {width: widthValue, height: heightValue} . o undefined to leave the width unchanged.

height : Mixed

The new height to set (not required if a size object is passed as the first arg). This may be one of:

o A Number specifying the new height in the Element 's Ext.Element.defaultUnit s (by default, pixels).

o A String used to set the CSS height style. Animation may not be used. o undefined to leave the height unchanged.

Returns:

Ext.Component

this

Component

 setValues (   Object   values   ) : Ext.form.FormPanel Sets the values of form fields in bulk. Example usage: myForm.setValues({ name: 'Ed', crazy: true, userna...Sets the values of form fields in bulk. Example usage: myForm.setValues({ name: 'Ed' , crazy: true, username: 'edspencer' });

If there groups of checkbox fields with the same name, pass their values in an array. For example: myForm.setValues({ name: 'Jacky' , crazy: false, hobbies: [

FormPanel

Page 42: Class Ext.form.Formpanel

'reading' , 'cooking' , 'gaming' ]});

Parameters:

values : Object

field name => value mapping object

Returns:

Ext.form.FormPanel

this

 

setVisible (   Boolean   visible   ) : Ext.Component Convenience function to hide or show this component by boolean.Convenience function to hide or show this component by boolean.Parameters:

visible : Boolean

True to show, false to hide

Returns:

Ext.Component

this

Component

 

setWidth (   Number   width   ) : Ext.Component Sets the width of the component. This method fires the resize event.Sets the width of the component. This method fires the resize event. Parameters:

width : Number

The new width to setThis may be one of:

o A Number specifying the new width in the Element 's Ext.Element.defaultUnit s (by default, pixels).

o A String used to set the CSS width style.

Returns:

Ext.Component

this

Component

 show (   [ Object/String/Boolean   animation ]   ) : void Compon

Page 43: Class Ext.form.Formpanel

Show the component.Show the component.Parameters:

animation : Object/String/Boolean

(optional) Defaults to false.

Returns:

void

ent

 

showBy (   Mixed   alignTo ,   Object/String/Boolean   animation ,   Boolean   allowOnSide   ) : voidShow this component relative another component or element.Show this component relative another component or element.Parameters:

alignTo : Mixed

Element or Component

animation : Object/String/Boolean allowOnSide : Boolean

true to allow this element to be aligned on the left or right.

Returns:

void

Component

 showMask (   String/Object   cfg ,   String/Element   target   ) : Ext.form.FormPanel Shows a generic/custom mask over a designated Element.Shows a generic/custom mask over a designated Element.Parameters:

cfg : String/Object

Either a string message or a configuration object supporting the following options:

{ message : 'Please Wait' , transparent : false, target : Ext.getBody(), //optional target Element cls : 'form-mask' , customImageUrl : 'trident.jpg' }

FormPanel

Page 44: Class Ext.form.Formpanel

This object is passed to the waitTpl for use with a custom masking implementation.

target : String/Element

The target Element instance or Element id to use as the masking agent for the operation (defaults the container Element of the component)

Returns:

Ext.form.FormPanel

this submit (   Object   options   ) : Ext.data.Connection Performs a Ajax-based submission of form values (if standardSubmit is false) or otherwise executes a standard HTML F...Performs a Ajax-based submission of form values (if standardSubmit is false) or otherwise executes a standard HTML Form submit action.Parameters:

options : Object

Unless otherwise noted, options may include the following:

o url : String

The url for the action (defaults to the form's url .)

o method : String

The form method to use (defaults to the form's method, or POST if not defined)

o params : String/Object

The params to pass (defaults to the FormPanel's baseParams, or none if not defined) Parameters are encoded as standard HTTP parameters using Ext.urlEncode .

o headers : Object

Request headers to set for the action (defaults to the form's default headers)

o autoAbort : Boolean

true to abort any pending Ajax request prior to submission (defaults to false) Note: Has no effect when standardSubmit is enabled.

FormPanel

Page 45: Class Ext.form.Formpanel

o submitDisabled : Boolean

true to submit all fields regardless of disabled state (defaults to false) Note: Has no effect when standardSubmit is enabled.

o waitMsg : String/Config

If specified, the value is applied to the waitTpl if defined, and rendered to the waitMsgTarget prior to a Form submit action.

o success : Function

The callback that will be invoked after a successful response. A response is successful if a response is received from the server and is a JSON object where the success property is set to true, {"success": true} The function is passed the following parameters:

form : Ext.FormPanel The form that requested the action result : The result object returned by the server as a result of the submit

request.o failure : Function

The callback that will be invoked after a failed transaction attempt. The function is passed the following parameters:

form : The Ext.FormPanel that requested the submit. result : The failed response or result object returned by the server

which performed the operation.o scope : Object

The scope in which to call the callback functions (The this reference for the callback functions).

Returns:

Ext.data.Connection

request Object suspendEvents (   Boolean   queueSuspended   ) : void Suspend the firing of all events. (see resumeEvents)Suspend the firing of all events. (see resumeEvents ) Parameters:

queueSuspended : Boolean

Pass as true to queue up suspended events to be fired after the resumeEvents call

Observable

Page 46: Class Ext.form.Formpanel

instead of discarding all suspended events;

Returns:

void

 

un (   String   eventName ,   Function   handler ,   [ Object   scope ]   ) : void Removes an event handler (shorthand for removeListener.)Removes an event handler (shorthand for removeListener .) Parameters:

eventName : String

The type of event the handler was associated with.

handler : Function

The handler to remove. This must be a reference to the function passed into the addListener call.

scope : Object

(optional) The scope originally specified for the handler.

Returns:

void

Observable

 up (   String   selector   ) : Ext.Container Walks up the ownerCt axis looking for an ancestor Container which matches the passed simple selector. Example:var own...

Walks up the ownerCt axis looking for an ancestor Container which matches the passed simple selector.

Example:

var owningTabContainer = grid.up( 'tabcontainer' );

Parameters:

selector : String

Optional. The simple selector to test.

Returns:

Component

Page 47: Class Ext.form.Formpanel

Ext.Container

The matching ancestor Container (or <code>undefined</code> if no match was found).

 

update (   Mixed   htmlOrData ,   [ Boolean   loadScripts ],   [ Function   callback ]   ) : void Update the content area of a component.Update the content area of a component.Parameters:

htmlOrData : Mixed

If this component has been configured with a template via the tpl config then it will use this argument as data to populate the template. If this component was not configured with a template, the components content area will be updated via Ext.Element update

loadScripts : Boolean

(optional) Only legitimate when using the html configuration. Defaults to false

callback : Function

(optional) Only legitimate when using the html configuration. Callback to execute when scripts have finished loading

Returns:

void

Component

 

updateRecord (   Ext.data.Model   instance ,   Boolean   enabled   ) : Ext.form.FormPanel Updates a model instance with the current values of this formUpdates a model instance with the current values of this formParameters:

instance : Ext.data.Model

The model instance

enabled : Boolean

true to update the Model with values from enabled fields only

Returns:

Ext.form.FormPanel

this

FormPanel

Page 48: Class Ext.form.Formpanel

Public Events

EventDefined

By

 

activate : (   Ext.Component   this   ) Fires after a Component has been visually activated.Fires after a Component has been visually activated.Listeners will be called with the following arguments:

this : Ext.Component

Component

 

add : (   Ext.Container   this ,   Ext.Component   component ,   Number   index   ) Listeners will be called with the following arguments:

this : Ext.Container component : Ext.Component

The component that was added

index : Number

The index at which the component was added to the container's items collection

Container

 

added : (   Ext.Component   this ,   Ext.Container   container ,   Number   pos   ) Fires after a Component had been added to a Container.Fires after a Component had been added to a Container.Listeners will be called with the following arguments:

this : Ext.Component container : Ext.Container

Parent Container

pos : Number

position of Component

Component

 

afterlayout : (   Ext.Container   this ,   ContainerLayout   layout   ) Fires when the components in this container are arranged by the associated layout manager.Fires when the components in this container are arranged by the associated layout manager.Listeners will be called with the following arguments:

this : Ext.Container layout : ContainerLayout

The ContainerLayout implementation for this container

Container

 afterrender : (   Ext.Component   this   ) Fires after the component rendering is finished. The afterrender event is fired after this Component has been rendere...

Component

Page 49: Class Ext.form.Formpanel

Fires after the component rendering is finished.

The afterrender event is fired after this Component has been rendered , been postprocesed by any afterRender method defined for the Component, and, if stateful , after state has been restored.

Listeners will be called with the following arguments:

this : Ext.Component

 

beforeactivate : (   Ext.Component   this   ) Fires before a Component has been visually activated. Returning false from an event listener can prevent the activate...Fires before a Component has been visually activated. Returning false from an event listener can prevent the activate from occurring.Listeners will be called with the following arguments:

this : Ext.Component

Component

 

beforeadd : (   Ext.Container   this ,   Ext.Component   component ,   Number   index   ) Fires before any Ext.Component is added or inserted into the container. A handler can return false to cancel the add.Fires before any Ext.Component is added or inserted into the container. A handler can return false to cancel the add.Listeners will be called with the following arguments:

this : Ext.Container component : Ext.Component

The component being added

index : Number

The index at which the component will be added to the container's items collection

Container

 beforecardswitch : (   Ext.Container   this ,   Ext.Component   newCard ,   Ext.Component   oldCard ,   Number   ind

ex ,   Boolean   animated   ) Fires before this container switches the active card. This event is only available if this container uses a CardLayou...Fires before this container switches the active card. This event is only available if this container uses a CardLayout. Note that TabPanel and Carousel both get a CardLayout by default, so both will have this event. A handler can return false to cancel the card switch.Listeners will be called with the following arguments:

this : Ext.Container newCard : Ext.Component

Container

Page 50: Class Ext.form.Formpanel

The card that will be switched to

oldCard : Ext.Component

The card that will be switched from

index : Number

The index of the card that will be switched to

animated : Boolean

True if this cardswitch will be animated

 

beforedeactivate : (   Ext.Component   this   ) Fires before a Component has been visually deactivated. Returning false from an event listener can prevent the deacti...Fires before a Component has been visually deactivated. Returning false from an event listener can prevent the deactivate from occurring.Listeners will be called with the following arguments:

this : Ext.Component

Component

 

beforedestroy : (   Ext.Component   this   ) Fires before the component is destroyed. Return false from an event handler to stop the destroy.Fires before the component is destroy ed. Return false from an event handler to stop the destroy . Listeners will be called with the following arguments:

this : Ext.Component

Component

 

beforehide : (   Ext.Component   this   ) Fires before the component is hidden when calling the hide method. Return false from an event handler to stop the hid...Fires before the component is hidden when calling the hide method. Return false from an event handler to stop the hide.Listeners will be called with the following arguments:

this : Ext.Component

Component

 beforeorientationchange : (   Ext.Panel   this ,   String   orientation ,   Number   width ,   Number   height   )

Fires before the orientation changes, if the monitorOrientation configuration is set to true. Return false to stop th...Fires before the orientation changes, if the monitorOrientation configuration is set to true. Return false to stop the orientation change.Listeners will be called with the following arguments:

Component

Page 51: Class Ext.form.Formpanel

this : Ext.Panel orientation : String

'landscape' or 'portrait'

width : Number height : Number

 

beforeremove : (   Ext.Container   this ,   Ext.Component   component   ) Fires before any Ext.Component is removed from the container. A handler can return false to cancel the remove.Fires before any Ext.Component is removed from the container. A handler can return false to cancel the remove.Listeners will be called with the following arguments:

this : Ext.Container component : Ext.Component

The component being removed

Container

 

beforerender : (   Ext.Component   this   ) Fires before the component is rendered. Return false from an event handler to stop the render.Fires before the component is rendered . Return false from an event handler to stop the render . Listeners will be called with the following arguments:

this : Ext.Component

Component

 

beforeshow : (   Ext.Component   this   ) Fires before the component is shown when calling the show method. Return false from an event handler to stop the show...Fires before the component is shown when calling the show method. Return false from an event handler to stop the show.Listeners will be called with the following arguments:

this : Ext.Component

Component

 beforesubmit : (   Ext.FormPanel   this ,   Object   values ,   Object   options   ) Fires immediately preceding any Form submit action. Implementations may adjust submitted form values or options prior...Fires immediately preceding any Form submit action. Implementations may adjust submitted form values or options prior to execution. A return value of false from this listener will abort the submission attempt (regardless of standardSubmit configuration)Listeners will be called with the following arguments:

this : Ext.FormPanel

FormPanel

Page 52: Class Ext.form.Formpanel

This FormPanel

values : Object

A hash collection of the qualified form values about to be submitted

options : Object

Submission options hash (only available when standardSubmit is false)

 

bodyresize : (   Ext.Panel   p ,   Number   width ,   Number   height   ) Fires after the Panel has been resized.Fires after the Panel has been resized.Listeners will be called with the following arguments:

p : Ext.Panel

the Panel which has been resized.

width : Number

The Panel body's new width.

height : Number

The Panel body's new height.

Panel

 cardswitch : (   Ext.Container   this ,   Ext.Component   newCard ,   Ext.Component   oldCard ,   Number   ind

ex ,   Boolean   animated   ) Fires after this container switches the active card. If the card is switched using an animation, this event will fire...Fires after this container switches the active card. If the card is switched using an animation, this event will fire after the animation has finished. This event is only available if this container uses a CardLayout. Note that TabPanel and Carousel both get a CardLayout by default, so both will have this event.Listeners will be called with the following arguments:

this : Ext.Container newCard : Ext.Component

The card that has been switched to

oldCard : Ext.Component

The card that has been switched from

index : Number

Container

Page 53: Class Ext.form.Formpanel

The index of the card that has been switched to

animated : Boolean

True if this cardswitch was animated

 

deactivate : (   Ext.Component   this   ) Fires after a Component has been visually deactivated.Fires after a Component has been visually deactivated.Listeners will be called with the following arguments:

this : Ext.Component

Component

 

destroy : (   Ext.Component   this   ) Fires after the component is destroyed.Fires after the component is destroy ed. Listeners will be called with the following arguments:

this : Ext.Component

Component

 

disable : (   Ext.Component   this   ) Fires after the component is disabled.Fires after the component is disabled.Listeners will be called with the following arguments:

this : Ext.Component

Component

 

enable : (   Ext.Component   this   ) Fires after the component is enabled.Fires after the component is enabled.Listeners will be called with the following arguments:

this : Ext.Component

Component

 exception : (   Ext.FormPanel   this ,   Object   result   ) Fires when either the Ajax HTTP request reports a failure OR the server returns a success:false response in the resul...Fires when either the Ajax HTTP request reports a failure OR the server returns a success:false response in the result payload.Listeners will be called with the following arguments:

this : Ext.FormPanel

This FormPanel

result : Object

FormPanel

Page 54: Class Ext.form.Formpanel

Either a failed Ext.data.Connection request object or a failed (logical) server response payload.

 

hide : (   Ext.Component   this   ) Fires after the component is hidden. Fires after the component is hidden when calling the hide method.Fires after the component is hidden. Fires after the component is hidden when calling the hide method. Listeners will be called with the following arguments:

this : Ext.Component

Component

 

move : (   Ext.Component   this ,   Number   x ,   Number   y   ) Fires after the component is moved.Fires after the component is moved.Listeners will be called with the following arguments:

this : Ext.Component x : Number

The new x position

y : Number

The new y position

Component

 

orientationchange : (   Ext.Panel   this ,   String   orientation ,   Number   width ,   Number   height   )

Fires when the orientation changes, if the monitorOrientation configuration is set to true.Fires when the orientation changes, if the monitorOrientation configuration is set to true.Listeners will be called with the following arguments:

this : Ext.Panel orientation : String

'landscape' or 'portrait'

width : Number height : Number

Component

 

remove : (   Ext.Container   this ,   Ext.Component   component   ) Listeners will be called with the following arguments:

this : Ext.Container component : Ext.Component

The component that was removed

Container

 removed : (   Ext.Component   this ,   Ext.Container   ownerCt   ) Compon

Page 55: Class Ext.form.Formpanel

Fires when a component is removed from an Ext.ContainerFires when a component is removed from an Ext.ContainerListeners will be called with the following arguments:

this : Ext.Component ownerCt : Ext.Container

Container which holds the component

ent

 

render : (   Ext.Component   this   ) Fires after the component markup is rendered.Fires after the component markup is rendered . Listeners will be called with the following arguments:

this : Ext.Component

Component

 

resize : (   Ext.Component   this ,   Number   adjWidth ,   Number   adjHeight ,   Number   rawWidth ,   Numbe

r   rawHeight   ) Fires after the component is resized.Fires after the component is resized.Listeners will be called with the following arguments:

this : Ext.Component adjWidth : Number

The box-adjusted width that was set

adjHeight : Number

The box-adjusted height that was set

rawWidth : Number

The width that was originally specified

rawHeight : Number

The height that was originally specified

Component

 

show : (   Ext.Component   this   ) Fires after the component is shown when calling the show method.Fires after the component is shown when calling the show method. Listeners will be called with the following arguments:

this : Ext.Component

Component

 submit : (   Ext.FormPanel   this ,   Object   result   ) Fires upon successful (Ajax-based) form submissionFires upon successful (Ajax-based) form submission

FormPanel

Page 56: Class Ext.form.Formpanel

Listeners will be called with the following arguments:

this : Ext.FormPanel

This FormPanel

result : Object

The result object as returned by the server

.FormPanelPackage: Ext.formDefined In: FormPanel.jsClass: FormPanelExtends: Panel

Simple form panel which enables easy getting and setting of field values. Can load model instances. Example usage:

var form = new Ext.form.FormPanel({ items: [ { xtype: 'textfield', name : 'first', label: 'First name' }, { xtype: 'textfield', name : 'last', label: 'Last name' }, { xtype: 'numberfield', name : 'age', label: 'Age' }, { xtype: 'urlfield', name : 'url', label: 'Website' } ]});

Loading model instances:

Ext.regModel('User', { fields: [ {name: 'first', type: 'string'}, {name: 'last', type: 'string'}, {name: 'age', type: 'int'},

Page 57: Class Ext.form.Formpanel

{name: 'url', type: 'string'} ]});

var user = Ext.ModelMgr.create({ first: 'Ed', last : 'Spencer', age : 24, url : 'http://extjs.com'}, 'User');

form.load(user);

Config Options

Config OptionsDefined

By

 

activeItem : String/NumberA string component id or the numeric index of the component that should be initially activated within the container's...A string component id or the numeric index of the component that should be initially activated within the container's layout on render. For example, activeItem: 'item-1' or activeItem: 0 (index 0 = the first item in the container's collection). activeItem only applies to layout styles that can display items one at a time (like Ext.layout.CardLayout and Ext.layout.FitLayout). Related to Ext.layout.ContainerLayout.activeItem.

Container

 

autoDestroy : BooleanIf true the container will automatically destroy any contained component that is removed from it, else destruction mu...If true the container will automatically destroy any contained component that is removed from it, else destruction must be handled manually (defaults to true).

Container

 baseCls : StringThe base CSS class to apply to this panel's element (defaults to 'x-panel').

Panel

 baseParams : ObjectOptional hash of params to be sent (when standardSubmit configuration is false) on every submit.

FormPanel

 

bodyBorder : Number/BooleanA shortcut for setting a border style on the body element. The value can either be a number to be applied to all side...A shortcut for setting a border style on the body element. The value can either be a number to be applied to all sides, or a normal css string describing borders. Defaults to undefined.

Panel

 

bodyMargin : Number/BooleanA shortcut for setting a margin style on the body element. The value can either be a number to be applied to all side...A shortcut for setting a margin style on the body element. The value can either be a number to be applied to all sides, or a normal css string describing margins. Defaults to undefined.

Panel

 bodyPadding : Number/BooleanA shortcut for setting a padding style on the body element. The value can either be a

Panel

Page 58: Class Ext.form.Formpanel

number to be applied to all sid...A shortcut for setting a padding style on the body element. The value can either be a number to be applied to all sides, or a normal css string describing padding. Defaults to undefined.

 

border : Number/StringSpecifies the border for this component. The border can be a single numeric value to apply to all sides or it can be ...Specifies the border for this component. The border can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.

Component

 

bubbleEvents : ArrayAn array of events that, when fired, should be bubbled to any parent container. See Ext.util.Observable.enableBubble....

An array of events that, when fired, should be bubbled to any parent container. See Ext.util.Observable.enableBubble. Defaults to ['add', 'remove'].

Container

 

cardSwitchAnimation : String/MixedAnimation to be used during transitions of cards. Note this only works when this container has a CardLayout. Any vali...Animation to be used during transitions of cards. Note this only works when this container has a CardLayout. Any valid value from Ext.anims can be used ('fade', 'slide', 'flip', 'cube', 'pop', 'wipe'). Defaults to null.

Container

 centered : BooleanCenter the Component. Defaults to false.

Component

 

cls : StringAn optional extra CSS class that will be added to this component's Element (defaults to ''). This can be useful for ...An optional extra CSS class that will be added to this component's Element (defaults to ''). This can be useful for adding customized styles to the component or any of its children using standard CSS rules.

Component

 componentCls : StringCSS Class to be added to a components root level element to give distinction to it via styling.

Component

 

componentLayout : String/ObjectThe sizing and positioning of the component Elements is the responsibility of the Component's layout manager which cr...

The sizing and positioning of the component Elements is the responsibility of the Component's layout manager which creates and manages the type of layout specific to the component.

If the layout configuration is not explicitly specified for a general purpose compopnent the default layout manager will be used.

Component

 contentEl : StringOptional. Specify an existing HTML element, or the id of an existing HTML element to use as the content for this comp...

Optional. Specify an existing HTML element, or the id of an existing HTML element to

Component

Page 59: Class Ext.form.Formpanel

use as the content for this component.

Description :

This config option is used to take an existing HTML element and place it in the layout element of a new component (it simply moves the specified DOM element after the Component is rendered to use as the content.

Notes :

The specified HTML element is appended to the layout element of the component after any configured HTML has been inserted, and so the document will not contain this element at the time the render event is fired.

The specified HTML element used will not participate in any layout scheme that the Component may use. It is just HTML. Layouts operate on child items.

Add either the x-hidden or the x-hide-display CSS class to prevent a brief flicker of the content before it is rendered to the panel.

 data : MixedThe initial set of data to apply to the tpl to update the content area of the Component.

Component

 

defaultType : StringThe default xtype of child Components to create in this Container when a child item is specified as a raw configurati...

The default xtype of child Components to create in this Container when a child item is specified as a raw configuration object, rather than as an instantiated Component.

Defaults to 'panel'.

Container

 defaults : Object|FunctionThis option is a means of applying default settings to all added items whether added through the items config or via ...

This option is a means of applying default settings to all added items whether added through the items config or via the add or insert methods.

If an added item is a config object, and not an instantiated Component, then the default properties are unconditionally applied. If the added item is an instantiated Component, then the default properties are applied conditionally so as not to override existing properties in the item.

If the defaults option is specified as a function, then the function will be called using this Container as the scope (this reference) and passing the added item as the first parameter. Any resulting object from that call is then applied to the item as default properties.

For example, to automatically apply padding to the body of each of a set of contained

Container

Page 60: Class Ext.form.Formpanel

Ext.Panel items, you could pass: defaults: {bodyStyle:'padding:15px'}.

Usage:

defaults: { // defaults are applied to items, not the container autoScroll:true},items: [ { xtype: 'panel', // defaults do not have precedence over id: 'panel1', // options in config objects, so the defaults autoScroll: false // will not be applied here, panel1 will be autoScroll:false }, new Ext.Panel({ // defaults do have precedence over options id: 'panel2', // options in components, so the defaults autoScroll: false // will be applied here, panel2 will be autoScroll:true. })]

 disabled : BooleanDefaults to false.

Component

 disabledCls : StringCSS class to add when the Component is disabled. Defaults to 'x-item-disabled'.

Component

 

dockedItems : Object/ArrayA component or series of components to be added as docked items to this panel. The docked items can be docked to eith...A component or series of components to be added as docked items to this panel. The docked items can be docked to either the top, right, left or bottom of a panel. This is typically used for things like toolbars or tab bars: var panel = new Ext.Panel({ fullscreen: true, dockedItems: [{ xtype: 'toolbar', dock: 'top', items: [{ text: 'Docked to the bottom' }] }]});

Panel

 draggable : BooleanAllows the component to be dragged via the touch event.

Component

 floating : BooleanCreate the Component as a floating and use absolute positioning. Defaults to false.

Component

 floatingCls : BooleanThe class that is being added to this component when its floating. (defaults to x-floating)

Component

  fullscreen : BooleanForce the component to take up 100% width and height available. Defaults to false. Setting this configuration immedia...Force the component to take up 100% width and height available. Defaults to false. Setting this configuration immediately sets the monitorOrientation config to true. Setting

Component

Page 61: Class Ext.form.Formpanel

this to true will render the component instantly.

 height : NumberThe height of this component in pixels.

Component

 hidden : BooleanDefaults to false.

Component

 

hideOnMaskTap : BooleanTrue to automatically bind a tap listener to the mask that hides the window. Defaults to true. Note: if you set this ...True to automatically bind a tap listener to the mask that hides the window. Defaults to true. Note: if you set this property to false you have to programmaticaly hide the overlay.

Component

 

html : String/ObjectAn HTML fragment, or a DomHelper specification to use as the layout element content (defaults to ''). The HTML conten...An HTML fragment, or a DomHelper specification to use as the layout element content (defaults to ''). The HTML content is added after the component is rendered, so the document will not contain this HTML at the time the render event is fired. This content is inserted into the body before any configured contentEl is appended.

Component

  items : Object/Array** IMPORTANT: be sure to specify a layout if needed ! ** A single item, or an array of child Components to be added t...** IMPORTANT: be sure to specify a layout if needed ! **

A single item, or an array of child Components to be added to this container, for example:

// specifying a single itemitems: {...},layout: 'fit', // specify a layout!

// specifying multiple itemsitems: [{...}, {...}],layout: 'hbox', // specify a layout!

Each item may be:

any type of object based on Ext.Component a fully instanciated object or an object literal that:

o has a specified xtypeo the Ext.Component.xtype specified is associated with the Component

desired and should be chosen from one of the available xtypes as listed in Ext.Component.

o If an xtype is not explicitly specified, the defaultType for that Container is used.

o will be "lazily instanciated", avoiding the overhead of constructing a fully instanciated Component object

Notes:

Ext uses lazy rendering. Child Components will only be rendered should it become

Container

Page 62: Class Ext.form.Formpanel

necessary. Items are automatically laid out when they are first shown (no sizing is done while hidden), or in response to a doLayout call.

Do not specify contentEl/ html with items.

  layout : String/Object*Important: In order for child items to be correctly sized and positioned, typically a layout manager must be specifi...

*Important: In order for child items to be correctly sized and positioned, typically a layout manager must be specified through the layout configuration option.

The sizing and positioning of child items is the responsibility of the Container's layout manager which creates and manages the type of layout you have in mind. For example:

If the layout configuration is not explicitly specified for a general purpose container (e.g. Container or Panel) the default layout manager will be used which does nothing but render child components sequentially into the Container (no sizing or positioning will be performed in this situation).

layout may be specified as either as an Object or as a String:

Specify as an Object o Example usage:

layout: { type: 'vbox', align: 'left'}

o type

The layout type to be used for this container. If not specified, a default Ext.layout.ContainerLayout will be created and used.

Valid layout type values are:

auto     Default card fit hbox vbox

Container

Page 63: Class Ext.form.Formpanel

o Layout specific configuration properties

Additional layout specific configuration properties may also be specified. For complete details regarding the valid config options for each layout type, see the layout class corresponding to the type specified.

Specify as a String o Example usage:

layout: { type: 'vbox', padding: '5', align: 'left'}

o layout

The layout type to be used for this container (see list of valid layout type values above).

Additional layout specific configuration properties. For complete details regarding the valid config options for each layout type, see the layout class corresponding to the layout specified.

 

layoutOnOrientationChange : BooleanSet this to true to automatically relayout this component on orientation change. This property is set to true by defa...Set this to true to automatically relayout this component on orientation change. This property is set to true by default if a component is floating unless you specifically set this to false. Also note that you dont have to set this property to true if this component is a child of a fullscreen container, since fullscreen components are also laid out automatically on orientation change. Defaults to null

Component

  listeners : ObjectA config object containing one or more event handlers to be added to this object during initialization. This should ...

A config object containing one or more event handlers to be added to this object during initialization. This should be a valid listeners config object as specified in the addListener example for attaching multiple handlers at once.

DOM events from ExtJs Components

Observable

Page 64: Class Ext.form.Formpanel

While some ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this is usually only done when extra value can be added. For example the DataView's click event passing the node clicked on. To access DOM events directly from a child element of a Component, we need to specify the element option to identify the Component property to add a DOM listener to:

new Ext.Panel({ width: 400, height: 200, dockedItems: [{ xtype: 'toolbar' }], listeners: { click: { element: 'el', //bind to the underlying el property on the panel fn: function(){ console.log('click el'); } }, dblclick: { element: 'body', //bind to the underlying body property on the panel fn: function(){ console.log('dblclick body'); } } }});

 

margin : Number/StringSpecifies the margin for this component. The margin can be a single numeric value to apply to all sides or it can be ...Specifies the margin for this component. The margin can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.

Component

 

maxHeight : NumberThe maximum value in pixels which this Component will set its height to. Warning: This will override any size managem...

The maximum value in pixels which this Component will set its height to.

Warning: This will override any size management applied by layout managers.

Component

 

maxWidth : NumberThe maximum value in pixels which this Component will set its width to. Warning: This will override any size manageme...

The maximum value in pixels which this Component will set its width to.

Warning: This will override any size management applied by layout managers.

Component

 minHeight : NumberThe minimum value in pixels which this Component will set its height to. Warning: This will override any size managem...

Component

Page 65: Class Ext.form.Formpanel

The minimum value in pixels which this Component will set its height to.

Warning: This will override any size management applied by layout managers.

 

minWidth : NumberThe minimum value in pixels which this Component will set its width to. Warning: This will override any size manageme...

The minimum value in pixels which this Component will set its width to.

Warning: This will override any size management applied by layout managers.

Component

 

modal : BooleanTrue to make the Component modal and mask everything behind it when displayed, false to display it without restrictin...True to make the Component modal and mask everything behind it when displayed, false to display it without restricting access to other UI elements (defaults to false).

Component

 monitorOrientation : BooleanMonitor Orientation change

Component

 

padding : Number/StringSpecifies the padding for this component. The padding can be a single numeric value to apply to all sides or it can b...Specifies the padding for this component. The padding can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.

Component

 

plugins : Object/ArrayAn object or array of objects that will provide custom functionality for this component. The only requirement for a ...An object or array of objects that will provide custom functionality for this component. The only requirement for a valid plugin is that it contain an init method that accepts a reference of type Ext.Component. When a component is created, if any plugins are available, the component will call the init method on each plugin, passing a reference to itself. Each plugin can then call methods or respond to events on the component as needed to provide its functionality.

Component

 renderSelectors. : ObjectAn object containing properties specifying DomQuery selectors which identify child elements created by the render pro...

An object containing properties specifying DomQuery selectors which identify child elements created by the render process.

After the Component's internal structure is rendered according to the renderTpl, this object is iterated through, and the found Elements are added as properties to the Component using the renderSelector property name.

For example, a Component which rendered an image, and description into its element might use the following properties coded into its prototype:

Component

Page 66: Class Ext.form.Formpanel

renderTpl: ' "{imageUrl}" class="x-image-component-img">"x-image-component-desc">{description}',

renderSelectors: { image: 'img.x-image-component-img', descEl: 'div.x-image-component-desc'}

After rendering, the Component would have a property image referencing its child img Element, and a property descEl referencing the div Element which contains the description.

 

renderTo : MixedSpecify the id of the element, a DOM element or an existing Element that this component will be rendered into. Notes ...

Specify the id of the element, a DOM element or an existing Element that this component will be rendered into.

Notes :

Do not use this option if the Component is to be a child item of a Container. It is the responsibility of the Container's layout manager to render and manage its child items.

When using this config, a call to render() is not required.

See render also.

Component

 

renderTpl : MixedAn XTemplate used to create the internal structure inside this Component's encapsulating Element. You do not normally...

An XTemplate used to create the internal structure inside this Component's encapsulating Element.

You do not normally need to specify this. For the base classes Ext.Component and Ext.Container, this defaults to null which means that they will be initially rendered with no internal structure; they render their Element empty. The more specialized ExtJS and Touch classes which use a more complex DOM structure, provide their own template definitions.

This is intended to allow the developer to create application-specific utility Components with customized internal structure.

Upon rendering, any created child elements may be automatically imported into object properties using the renderSelectors option.

Component

  scroll : MixedConfigure the component to be scrollable. Acceptable values are: 'horizontal', 'vertical',

Component

Page 67: Class Ext.form.Formpanel

'both' to enabling scroll...Configure the component to be scrollable. Acceptable values are:

'horizontal', 'vertical', 'both' to enabling scrolling for that direction. A Scroller configuration. false to explicitly disable scrolling.

Enabling scrolling immediately sets the monitorOrientation config to true (for Panel)

 

showAnimation : Object/String/BooleanThe type of animation you want to use when this component is shown. If you set this this hide animation will automati...The type of animation you want to use when this component is shown. If you set this this hide animation will automatically be the opposite.

Component

 standardSubmit : BooleanWether or not we want to perform a standard form submit. Defaults to false

FormPanel

 stopMaskTapEvent : BooleanTrue to stop the event that fires when you click outside the floating component. Defalts to true.

Component

 

style : StringA custom style specification to be applied to this component's Element. Should be a valid argument to Ext.Element.ap...A custom style specification to be applied to this component's Element. Should be a valid argument to Ext.Element.applyStyles. new Ext.Panel({ title: 'Some Title', renderTo: Ext.getBody(), width: 400, height: 300, layout: 'form', items: [{ xtype: 'textareafield', style: { width: '95%', marginBottom: '10px' } }, new Ext.Button({ text: 'Send', minWidth: '100', style: { marginBottom: '10px' } }) ] });

Component

 styleHtmlCls : StringThe class that is added to the content target when you set styleHtmlContent to true. Defaults to 'x-html'

Component

 

styleHtmlContent : StringTrue to automatically style the html inside the content target of this component (body for panels). Defaults to false...True to automatically style the html inside the content target of this component (body for panels). Defaults to false.

Component

Page 68: Class Ext.form.Formpanel

 

submitOnAction : ObjectWhen this is set to true, the form will automatically submit itself whenever the 'action' event fires on a field in t...When this is set to true, the form will automatically submit itself whenever the 'action' event fires on a field in this form. The action event usually fires whenever you press go or enter inside a textfield.

FormPanel

 

tpl : MixedAn Ext.Template, Ext.XTemplate or an array of strings to form an Ext.XTemplate. Used in conjunction with the data and...An Ext.Template, Ext.XTemplate or an array of strings to form an Ext.XTemplate. Used in conjunction with the data and tplWriteMode configurations.

Component

 

tplWriteMode : StringThe Ext.(X)Template method to use when updating the content area of the Component. Defaults to 'overwrite' (see Ext.X...The Ext.(X)Template method to use when updating the content area of the Component. Defaults to 'overwrite' (see Ext.XTemplate.overwrite).

Component

 

ui : StringA set of predefined ui styles for individual components. Most components support 'light' and 'dark'. Extra string add...A set of predefined ui styles for individual components. Most components support 'light' and 'dark'. Extra string added to the baseCls with an extra '-'. new Ext.Panel({ title: 'Some Title', baseCls: 'x-component' ui: 'green' });

The ui configuration in this example would add 'x-component-green' as an additional class.

Component

 url : StringThe default Url for submit actions

FormPanel

 

waitTpl : ObjectThe defined waitMsg template. Used for precise control over the masking agent used to mask the FormPanel (or other E...The defined waitMsg template. Used for precise control over the masking agent used to mask the FormPanel (or other Element) during form Ajax/submission actions. For more options, see showMask method.

FormPanel

 width : NumberThe width of this component in pixels.

Component

Public Properties

Property Defined By

 draggable : BooleanRead-only property indicating whether or not the component can be dragged

Component

 items : Ext.util.MixedCollectionThe MixedCollection containing all the child items of this container.

Container

 record : Ext.data.Model FormPanel

Page 69: Class Ext.form.Formpanel

The Model instance currently loaded into this form (if any). Read only

 rendered : BooleanRead-only property indicating whether or not the component has been rendered.

Component

Public Methods

MethodDefined

By add( ...Object/Array component ) : Ext.Component/ArrayAdds Component(s) to this Container. Description : <ul class="mdetail-params"> Fires the beforeadd event before addin...

Adds Component(s) to this Container.

Description :

Fires the beforeadd event before adding The Container's default config values will be applied accordingly (see defaults for

details). Fires the add event after the component has been added.

Notes :

If the Container is already rendered when add is called, you may need to call doLayout to refresh the view which causes any unrendered child Components to be rendered. This is required so that you can add multiple child components if needed while only refreshing the layout once. For example:

var tb = new Ext.Toolbar(); tb.render(document.body); // toolbar is rendered tb.add({text:'Button 1'}); // add multiple items (defaultType for

Toolbar is 'button') tb.add({text:'Button 2'});

tb.doLayout(); // refresh the layout

Warning: Containers directly managed by the BorderLayout layout manager may not be removed or added. See the Notes for BorderLayout for more details.

Parameters:

component : ...Object/Array

Either one or more Components to add or an Array of Components to add. See items for additional information.

Container

Page 70: Class Ext.form.Formpanel

Returns:

Ext.Component/Array

The Components that were added.

 

addCls() : voidAdds a CSS class to the top level element representing this component.Adds a CSS class to the top level element representing this component.Parameters:

None.

Returns:

void

Component

 

addDocked( Object/Array component., [Number pos] ) : voidAdds docked item(s) to the panel.Adds docked item(s) to the panel.Parameters:

component. : Object/Array

The Component or array of components to add. The components must include a 'dock' paramater on each component to indicate where it should be docked ('top', 'right', 'bottom', 'left').

pos : Number

(optional) The index at which the Component will be added

Returns:

void

Panel

 addEvents( Object|String o, string Optional. ) : voidAdds the specified events to the list of events which this Observable may fire.Adds the specified events to the list of events which this Observable may fire.Parameters:

o : Object|String

Either an object with event names as properties with a value of true or the first event name string if multiple event names are being passed as separate parameters.

Optional. : string

Observable

Page 71: Class Ext.form.Formpanel

Event name if multiple event names are being passed as separate parameters. Usage:

this.addEvents('storeloaded', 'storecleared');

Returns:

void

 addListener( String eventName, Function handler, [Object scope], [Object options] ) : voidAppends an event handler to this object.Appends an event handler to this object.Parameters:

eventName : String

The name of the event to listen for. May also be an object who's property names are event names. See

handler : Function

The method the event invokes.

scope : Object

(optional) The scope (this reference) in which the handler function is executed. If omitted, defaults to the object which fired the event.

options : Object

(optional) An object containing handler configuration. properties. This may contain any of the following properties:

o scope : Object

The scope (this reference) in which the handler function is executed. If omitted, defaults to the object which fired the event.

o delay : Number

The number of milliseconds to delay the invocation of the handler after the event fires.

o single : Boolean

True to add a handler to handle just the next firing of the event, and then remove itself.

Observable

Page 72: Class Ext.form.Formpanel

o buffer : Number

Causes the handler to be scheduled to run in an Ext.util.DelayedTask delayed by the specified number of milliseconds. If the event fires again within that time, the original handler is not invoked, but the new handler is scheduled in its place.

o target : Observable

Only call the handler if the event was fired on the target Observable, not if the event was bubbled up from a child Observable.

o element : String

This option is only valid for listeners bound to Components. The name of a Component property which references an element to add a listener to.

This option is useful during Component construction to add DOM event listeners to elements of Components which will exist only after the Component is rendered. For example, to add a click listener to a Panel's body:

new Ext.Panel({ title: 'The title', listeners: { click: this.handlePanelClick, element: 'body' }});

When added in this way, the options available are the options applicable to Ext.Element.addListener

Combining OptionsUsing the options argument, it is possible to combine different types of listeners:

A delayed, one-time listener.

myPanel.on('hide', this.handleClick, this, {single: true,delay: 100});

Attaching multiple handlers in 1 callThe method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:

myGridPanel.on({ cellClick: this.onCellClick,

Page 73: Class Ext.form.Formpanel

mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution});

.

Returns:

void

 

addManagedListener( Observable|Element item, Object|String ename, Function fn, Object scope, Object opt ) : voidAdds listeners to any Observable object (or Element) which are automatically removed when this Component is destroyed...

Adds listeners to any Observable object (or Element) which are automatically removed when this Component is destroyed.

Parameters:

item : Observable|Element

The item to which to add a listener/listeners.

ename : Object|String

The event name, or an object containing event name properties.

fn : Function

Optional. If the ename parameter was an event name, this is the handler function.

scope : Object

Optional. If the ename parameter was an event name, this is the scope (this reference) in which the handler function is executed.

opt : Object

Optional. If the ename parameter was an event name, this is the addListener options.

Returns:

void

Observable

 child( String selector ) : Ext.ComponentRetrieves the first direct child of this container which matches the passed selector. The passed

Container

Page 74: Class Ext.form.Formpanel

in selector must com...Retrieves the first direct child of this container which matches the passed selector. The passed in selector must comply with an Ext.ComponentQuery selector.Parameters:

selector : String

An Ext.ComponentQuery selector

Returns:

Ext.Component

 

clearListeners() : voidRemoves all listeners for this object including the managed listenersRemoves all listeners for this object including the managed listenersParameters:

None.

Returns:

void

Observable

 

clearManagedListeners() : voidRemoves all managed listeners for this object.Removes all managed listeners for this object.Parameters:

None.

Returns:

void

Observable

 

destroy() : voidDestroys the Component.Destroys the Component.Parameters:

None.

Returns:

void

Component

 disable() : Ext.form.FormPanelA convenient method to disable all fields in this forms

FormPanel

Page 75: Class Ext.form.Formpanel

A convenient method to disable all fields in this formsParameters:

None.

Returns:

Ext.form.FormPanel

this This form

 

doComponentLayout() : Ext.ContainerThis method needs to be called whenever you change something on this component that requires the components layout to...This method needs to be called whenever you change something on this component that requires the components layout to be recalculated. An example is adding, showing or hiding a docked item to a Panel, or changing the label of a form field. After a component layout, the container layout will automatically be run. So you could be on the safe side and always call doComponentLayout instead of doLayout.Parameters:

None.

Returns:

Ext.Container

this

Component

 

doLayout() : Ext.ContainerForce this container's layout to be recalculated. A call to this function is required after adding a new component to...Force this container's layout to be recalculated. A call to this function is required after adding a new component to an already rendered container, or possibly after changing sizing/position properties of child components.Parameters:

None.

Returns:

Ext.Container

this

Container

 down( String selector ) : Ext.ComponentRetrieves the first descendant of this container which matches the passed selector. The passed in selector must compl...Retrieves the first descendant of this container which matches the passed selector. The passed in selector must comply with an Ext.ComponentQuery selector.Parameters:

Container

Page 76: Class Ext.form.Formpanel

selector : String

An Ext.ComponentQuery selector

Returns:

Ext.Component

 

enable() : Ext.form.FormPanelA convenient method to enable all fields in this formsA convenient method to enable all fields in this formsParameters:

None.

Returns:

Ext.form.FormPanel

this This form

FormPanel

 enableBubble( String/Array events ) : voidEnables events fired by this Observable to bubble up an owner hierarchy by calling this.getBubbleTarget() if present....

Enables events fired by this Observable to bubble up an owner hierarchy by calling this.getBubbleTarget() if present. There is no implementation in the Observable base class.

This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.

Example:

Ext.override(Ext.form.Field, {// Add functionality to Field's initComponent to enable the change event to bubbleinitComponent : Ext.createSequence(Ext.form.Field.prototype.initComponent, function() { this.enableBubble('change');}),

// We know that we want Field's events to bubble directly to the FormPanel.getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel;

Observable

Page 77: Class Ext.form.Formpanel

}});

var myForm = new Ext.formPanel({title: 'User Details',items: [{ ...}],listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); }}});

Parameters:

events : String/Array

The event name to bubble, or an Array of event names.

Returns:

void

 

fireEvent( String eventName, Object... args ) : BooleanFires the specified event with the passed parameters (minus the event name). An event may be set to bubble up an Obse...

Fires the specified event with the passed parameters (minus the event name).

An event may be set to bubble up an Observable parent hierarchy (See Ext.Component.getBubbleTarget) by calling enableBubble.

Parameters:

eventName : String

The name of the event to fire.

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.

Observable

 getActiveItem() : activeItemReturns the current activeItem for the layout (only for a card layout)

Container

Page 78: Class Ext.form.Formpanel

Returns the current activeItem for the layout (only for a card layout)Parameters:

None.

Returns:

activeItem

activeItem Current active component

 

getBubbleTarget() : Ext.ContainerProvides the link for Observable's fireEvent method to bubble up the ownership hierarchy.Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.Parameters:

None.

Returns:

Ext.Container

the Container which owns this Component.

Component

 

getComponent( String/Number comp ) : Ext.ComponentAttempts a default component lookup (see Ext.Container.getComponent). If the component is not found in the normal ite...Attempts a default component lookup (see Ext.Container.getComponent). If the component is not found in the normal items, the dockedItems are searched and the matched component (if any) returned (see {@loink #getDockedComponent}).Parameters:

comp : String/Number

The docked component id or itemId to find

Returns:

Ext.Component

The docked component, if found

Panel

 getDockedComponent( String/Number comp ) : Ext.ComponentFinds a docked component by id, itemId or positionFinds a docked component by id, itemId or positionParameters:

comp : String/Number

The id, itemId or position of the child component (see getComponent for details)

Panel

Page 79: Class Ext.form.Formpanel

Returns:

Ext.Component

The component (if found)

 

getDockedItems() : ArrayRetrieve an array of all currently docked components.Retrieve an array of all currently docked components.Parameters:

None.

Returns:

Array

An array of components.

Panel

 

getEl() : voidRetrieves the top level element representing this component.Retrieves the top level element representing this component.Parameters:

None.

Returns:

void

Component

 

getHeight() : NumberGets the current height of the component's underlying element.Gets the current height of the component's underlying element.Parameters:

None.

Returns:

Number

Component

 getId() : voidRetrieves the id of this component. Will autogenerate an id if one has not already been set.Retrieves the id of this component. Will autogenerate an id if one has not already been set.Parameters:

None.

Returns:

Component

Page 80: Class Ext.form.Formpanel

void

 

getInsertPosition( String/Number/Element/HTMLElement position ) : HTMLElementThis function takes the position argument passed to onRender and returns a DOM element that you can use in the insert...This function takes the position argument passed to onRender and returns a DOM element that you can use in the insertBefore.Parameters:

position : String/Number/Element/HTMLElement

Index, element id or element you want to put this component before.

Returns:

HTMLElement

DOM element that you can use in the insertBefore

Component

 

getLayout() : Ext.layout.ContainerLayoutReturns the layout instance currently associated with this Container. If a layout has not been instantiated yet, that...Returns the layout instance currently associated with this Container. If a layout has not been instantiated yet, that is done firstParameters:

None.

Returns:

Ext.layout.ContainerLayout

The layout

Container

 

getRecord() : Ext.data.ModelReturns the Model instance currently loaded into this form (if any)Returns the Model instance currently loaded into this form (if any)Parameters:

None.

Returns:

Ext.data.Model

The Model instance

FormPanel

 getSize() : ObjectGets the current size of the component's underlying element.Gets the current size of the component's underlying element.

Component

Page 81: Class Ext.form.Formpanel

Parameters:

None.

Returns:

Object

An object containing the element's size {width: (element width), height: (element height)}

 

getValues( Boolean enabled ) : ObjectReturns an object containing the value of each field in the form, keyed to the field's name. For groups of checkbox ...Returns an object containing the value of each field in the form, keyed to the field's name. For groups of checkbox fields with the same name, it will be arrays of values. For examples: { name: "Jacky Nguyen", // From a TextField favorites: [ 'pizza', 'noodle', 'cake' ] }

Parameters:

enabled : Boolean

true to return only enabled fields

Returns:

Object

Object mapping field name to its value

FormPanel

 

getWidth() : NumberGets the current width of the component's underlying element.Gets the current width of the component's underlying element.Parameters:

None.

Returns:

Number

Component

 getXTypes() : StringReturns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the Ext...

Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all

Component

Page 82: Class Ext.form.Formpanel

available xtypes, see the Ext.Component header.

If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.

Example usage:

var t = new Ext.form.Text();alert(t.getXTypes()); // alerts 'component/field/textfield'

Parameters:

None.

Returns:

String

The xtype hierarchy string

 

hasListener( String eventName ) : BooleanChecks to see if this object has any listeners for a specified eventChecks to see if this object has any listeners for a specified eventParameters:

eventName : String

The name of the event to check for

Returns:

Boolean

True if the event is being listened for, else false

Observable

 

hide( [Object/String/Boolean animation] ) : voidHide the componentHide the componentParameters:

animation : Object/String/Boolean

(optional) Defaults to false.

Returns:

void

Component

 hideMask() : Ext.form.FormPanelHides a previously shown wait mask (See showMask)Hides a previously shown wait mask (See showMask)

FormPanel

Page 83: Class Ext.form.Formpanel

Parameters:

None.

Returns:

Ext.form.FormPanel

this

 

insert( Number index, Ext.Component component ) : Ext.ComponentInserts a Component into this Container at a specified index. Fires the beforeadd event before inserting, then fires ...Inserts a Component into this Container at a specified index. Fires the beforeadd event before inserting, then fires the add event after the Component has been inserted.Parameters:

index : Number

The index at which the Component will be inserted into the Container's items collection

component : Ext.Component

The child Component to insert.

Ext uses lazy rendering, and will only render the inserted Component should it become necessary.

A Component config object may be passed in order to avoid the overhead of constructing a real Component object if lazy rendering might mean that the inserted Component will not be rendered immediately. To take advantage of this 'lazy instantiation', set the Ext.Component.xtype config property to the registered type of the Component wanted.

For a list of all available xtypes, see Ext.Component.

Returns:

Ext.Component

component The Component (or config object) that was inserted with the Container's default config values applied.

Container

 insertDocked( Number pos, Object/Array component. ) : voidInserts docked item(s) to the panel at the indicated position.Inserts docked item(s) to the panel at the indicated position.Parameters:

Panel

Page 84: Class Ext.form.Formpanel

pos : Number

The index at which the Component will be inserted

component. : Object/Array

The Component or array of components to add. The components must include a 'dock' paramater on each component to indicate where it should be docked ('top', 'right', 'bottom', 'left').

Returns:

void

 

isDisabled() : BooleanMethod to determine whether this Component is currently disabled.Method to determine whether this Component is currently disabled.Parameters:

None.

Returns:

Boolean

the disabled state of this Component.

Component

 

isDraggable() : BooleanMethod to determine whether this Component is draggable.Method to determine whether this Component is draggable.Parameters:

None.

Returns:

Boolean

the draggable state of this component.

Component

 isDroppable() : BooleanMethod to determine whether this Component is droppable.Method to determine whether this Component is droppable.Parameters:

None.

Returns:

Component

Page 85: Class Ext.form.Formpanel

Boolean

the droppable state of this component.

 

isFloating() : BooleanMethod to determine whether this Component is floating.Method to determine whether this Component is floating.Parameters:

None.

Returns:

Boolean

the floating state of this component.

Component

 

isHidden() : BooleanMethod to determine whether this Component is currently set to hidden.Method to determine whether this Component is currently set to hidden.Parameters:

None.

Returns:

Boolean

the hidden state of this Component.

Component

 

isVisible() : BooleanReturns true if this component is visible.Returns true if this component is visible.Parameters:

None.

Returns:

Boolean

True if this component is visible, false otherwise.

Component

 isXType( String xtype, [Boolean shallow] ) : BooleanTests whether or not this Component is of a specific xtype. This can test whether this Component is descended from th...

Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from the xtype (default) or whether it is directly of the xtype specified (shallow = true).

If using your own subclasses, be aware that a Component must register its own xtype to

Component

Page 86: Class Ext.form.Formpanel

participate in determination of inherited xtypes.

For a list of all available xtypes, see the Ext.Component header.

Example usage:

var t = new Ext.form.Text();var isText = t.isXType('textfield'); // truevar isBoxSubclass = t.isXType('field'); // true, descended from Ext.form.Fieldvar isBoxInstance = t.isXType('field', true); // false, not a direct Ext.form.Field instance

Parameters:

xtype : String

The xtype to check for this Component

shallow : Boolean

(optional) False to check whether this Component is descended from the xtype (this is the default), or true to check whether this Component is directly of the specified xtype.

Returns:

Boolean

True if this component descends from the specified xtype, false otherwise.

 

load( Ext.data.Model instance ) : Ext.form.FormPanel(Shortcut to loadRecord method) Loads matching fields from a model instance into this form(Shortcut to loadRecord method) Loads matching fields from a model instance into this formParameters:

instance : Ext.data.Model

The model instance

Returns:

Ext.form.FormPanel

this

FormPanel

 loadRecord( Ext.data.Model instance ) : Ext.form.FormPanelLoads matching fields from a model instance into this formLoads matching fields from a model instance into this formParameters:

FormPanel

Page 87: Class Ext.form.Formpanel

instance : Ext.data.Model

The model instance

Returns:

Ext.form.FormPanel

this

 

nextSibling( selector Optional. ) : voidReturns the next sibling of this Component. Optionally selects the next sibling which matches the passed ComponentQue...

Returns the next sibling of this Component.

Optionally selects the next sibling which matches the passed ComponentQuery selector.

May also be refered to as prev()

Parameters:

Optional. : selector

A ComponentQuery selector to filter the following items.

Returns:

void

Component

 on( String eventName, Function handler, [Object scope], [Object options] ) : voidAppends an event handler to this object (shorthand for addListener.)Appends an event handler to this object (shorthand for addListener.)Parameters:

eventName : String

The type of event to listen for

handler : Function

The method the event invokes

scope : Object

(optional) The scope (this reference) in which the handler function is executed. If omitted, defaults to the object which fired the event.

Observable

Page 88: Class Ext.form.Formpanel

options : Object

(optional) An object containing handler configuration.

Returns:

void

 

previousSibling( selector Optional. ) : voidReturns the previous sibling of this Component. Optionally selects the previous sibling which matches the passed Comp...

Returns the previous sibling of this Component.

Optionally selects the previous sibling which matches the passed ComponentQuery selector.

May also be refered to as prev()

Parameters:

Optional. : selector

A ComponentQuery selector to filter the preceding items.

Returns:

void

Component

 

query( String selector ) : ArrayRetrieves all descendant components which match the passed selector. Executes an Ext.ComponentQuery.query using this ...Retrieves all descendant components which match the passed selector. Executes an Ext.ComponentQuery.query using this container as its root.Parameters:

selector : String

Selector complying to an Ext.ComponentQuery selector

Returns:

Array

Ext.Component's which matched the selector

Container

 relayEvents( Object o, Array events ) : voidRelays selected events from the specified Observable as if the events were fired by this.Relays selected events from the specified Observable as if the events were fired by this.

Observable

Page 89: Class Ext.form.Formpanel

Parameters:

o : Object

The Observable whose events this object is to relay.

events : Array

Array of event names to relay.

Returns:

void

 

remove( Component/String component, [Boolean autoDestroy] ) : Ext.ComponentRemoves a component from this container. Fires the beforeremove event before removing, then fires the remove event a...Removes a component from this container. Fires the beforeremove event before removing, then fires the remove event after the component has been removed.Parameters:

component : Component/String

The component reference or id to remove.

autoDestroy : Boolean

(optional) True to automatically invoke the removed Component's Ext.Component.destroy function. Defaults to the value of this Container's autoDestroy config.

Returns:

Ext.Component

component The Component that was removed.

Container

 removeAll( [Boolean autoDestroy] ) : ArrayRemoves all components from this container.Removes all components from this container.Parameters:

autoDestroy : Boolean

(optional) True to automatically invoke the removed Component's Ext.Component.destroy function. Defaults to the value of this Container's autoDestroy config.

Returns:

Container

Page 90: Class Ext.form.Formpanel

Array

Array of the destroyed components

 

removeCls() : voidRemoves a CSS class from the top level element representing this component.Removes a CSS class from the top level element representing this component.Parameters:

None.

Returns:

void

Component

 

removeDocked( Ext.Component item., [Boolean autoDestroy] ) : voidRemoves the docked item from the panel.Removes the docked item from the panel.Parameters:

item. : Ext.Component

The Component to remove.

autoDestroy : Boolean

(optional) Destroy the component after removal.

Returns:

void

Panel

 removeListener( String eventName, Function handler, [Object scope] ) : voidRemoves an event handler.Removes an event handler.Parameters:

eventName : String

The type of event the handler was associated with.

handler : Function

The handler to remove. This must be a reference to the function passed into the addListener call.

scope : Object

Observable

Page 91: Class Ext.form.Formpanel

(optional) The scope originally specified for the handler.

Returns:

void

 

removeManagedListener( Observable|Element item, Object|String ename, Function fn, Object scope ) : voidRemoves listeners that were added by the mon method.Removes listeners that were added by the mon method.Parameters:

item : Observable|Element

The item from which to remove a listener/listeners.

ename : Object|String

The event name, or an object containing event name properties.

fn : Function

Optional. If the ename parameter was an event name, this is the handler function.

scope : Object

Optional. If the ename parameter was an event name, this is the scope (this reference) in which the handler function is executed.

Returns:

void

Observable

 

reset() : Ext.form.FormPanelResets all fields in the form back to their original valuesResets all fields in the form back to their original valuesParameters:

None.

Returns:

Ext.form.FormPanel

this This form

FormPanel

 resumeEvents() : voidResume firing events. (see suspendEvents) If events were suspended using the

Observable

Page 92: Class Ext.form.Formpanel

queueSuspended parameter, then all event...Resume firing events. (see suspendEvents) If events were suspended using the queueSuspended parameter, then all events fired during event suspension will be sent to any listeners now.Parameters:

None.

Returns:

void

 

setActiveItem( Ext.Component/Number/Object card, [String/Object cardSwitchAnimation] ) : Ext.ContainerAllows you to set the active card in this container. This method is only available if the container uses a CardLayout...Allows you to set the active card in this container. This method is only available if the container uses a CardLayout. Note that a Carousel and TabPanel both get a CardLayout automatically, so both of those components are able to use this method.Parameters:

card : Ext.Component/Number/Object

The card you want to be made active. A number is interpreted as a card index. An object will be converted to a Component using the objects xtype property, then added to the container and made active. Passing a Component will make sure the component is a child of this container, and then make it active.

cardSwitchAnimation : String/Object

(optional) The cardSwitchAnimation used to switch between the cards. This can be an animation type string or an animation configuration object.

Returns:

Ext.Container

this

Container

 setCentered( Boolean centered ) : voidShow this component centered of its parent or the window This only applies when the component is floating.Show this component centered of its parent or the window This only applies when the component is floating.Parameters:

centered : Boolean

Component

Page 93: Class Ext.form.Formpanel

True to center, false to remove centering

Returns:

void

 

setDisabled( Boolean disabled ) : voidEnable or disable the component.Enable or disable the component.Parameters:

disabled : Boolean

Returns:

void

Component

 

setDocked() : ComponentSets the dock position of this component in its parent panel. Note that this only has effect if this item is part of ...Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)Parameters:

None.

Returns:

Component

this

Component

 setDraggable( Boolean/Mixed draggable, Boolean autoShow ) : voidSets a Component as draggable.Sets a Component as draggable.Parameters:

draggable : Boolean/Mixed

On first call, this can be a config object for Ext.util.Draggable. Afterwards, if set to false, the existing draggable object will be disabled

autoShow : Boolean

Returns:

Component

Page 94: Class Ext.form.Formpanel

void

 

setFloating( Boolean floating, Boolean autoShow ) : voidSets a Component as floating.Sets a Component as floating.Parameters:

floating : Boolean autoShow : Boolean

Returns:

void

Component

 

setHeight( Number height ) : Ext.ComponentSets the height of the component. This method fires the resize event.Sets the height of the component. This method fires the resize event.Parameters:

height : Number

The new height to set. This may be one of:

o A Number specifying the new height in the Element's Ext.Element.defaultUnits (by default, pixels).

o A String used to set the CSS height style.o undefined to leave the height unchanged.

Returns:

Ext.Component

this

Component

 setLoading( Boolean/Object load, Boolean targetEl ) : Ext.LoadMaskThis method allows you to show or hide a LoadMask on top of this component.This method allows you to show or hide a LoadMask on top of this component.Parameters:

load : Boolean/Object

True to show the default LoadMask or a config object that will be passed to the LoadMask constructor. False to hide the current LoadMask.

targetEl : Boolean

True to mask the targetEl of this Component instead of the this.el. For example, setting this to true on a Panel will cause only the body to be masked. (defaults to

Component

Page 95: Class Ext.form.Formpanel

false)

Returns:

Ext.LoadMask

The LoadMask instance that has just been shown.

 

setOrientation( String orientation, Number/String width, Number/String height ) : voidSets the orientation for the Panel.Sets the orientation for the Panel.Parameters:

orientation : String

'landscape' or 'portrait'

width : Number/String

New width of the Panel.

height : Number/String

New height of the Panel.

Returns:

void

Component

 setPosition( Number left, Number top ) : Ext.ComponentSets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires ...Sets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires the move event.Parameters:

left : Number

The new left

top : Number

The new top

Returns:

Component

Page 96: Class Ext.form.Formpanel

Ext.Component

this

 

setScrollable( Mixed config ) : voidSets a Component as scrollable.Sets a Component as scrollable.Parameters:

config : Mixed

Acceptable values are a Ext.Scroller configuration, 'horizontal', 'vertical', 'both', and false

Returns:

void

Component

 setSize( Mixed width, Mixed height ) : Ext.ComponentSets the width and height of this Component. This method fires the resize event. This method can accept either width ...Sets the width and height of this Component. This method fires the resize event. This method can accept either width and height as separate arguments, or you can pass a size object like {width:10, height:20}.Parameters:

width : Mixed

The new width to set. This may be one of:

o A Number specifying the new width in the Element's Ext.Element.defaultUnits (by default, pixels).

o A String used to set the CSS width style.o A size object in the format {width: widthValue, height: heightValue}.o undefined to leave the width unchanged.

height : Mixed

The new height to set (not required if a size object is passed as the first arg). This may be one of:

o A Number specifying the new height in the Element's Ext.Element.defaultUnits (by default, pixels).

o A String used to set the CSS height style. Animation may not be used.o undefined to leave the height unchanged.

Returns:

Component

Page 97: Class Ext.form.Formpanel

Ext.Component

this

 

setValues( Object values ) : Ext.form.FormPanelSets the values of form fields in bulk. Example usage: myForm.setValues({ name: 'Ed', crazy: true, userna...Sets the values of form fields in bulk. Example usage: myForm.setValues({ name: 'Ed', crazy: true, username: 'edspencer'});

If there groups of checkbox fields with the same name, pass their values in an array. For example: myForm.setValues({ name: 'Jacky', crazy: false, hobbies: [ 'reading', 'cooking', 'gaming' ]});

Parameters:

values : Object

field name => value mapping object

Returns:

Ext.form.FormPanel

this

FormPanel

 

setVisible( Boolean visible ) : Ext.ComponentConvenience function to hide or show this component by boolean.Convenience function to hide or show this component by boolean.Parameters:

visible : Boolean

True to show, false to hide

Returns:

Ext.Component

this

Component

 setWidth( Number width ) : Ext.ComponentSets the width of the component. This method fires the resize event.

Component

Page 98: Class Ext.form.Formpanel

Sets the width of the component. This method fires the resize event.Parameters:

width : Number

The new width to setThis may be one of:

o A Number specifying the new width in the Element's Ext.Element.defaultUnits (by default, pixels).

o A String used to set the CSS width style.

Returns:

Ext.Component

this

 

show( [Object/String/Boolean animation] ) : voidShow the component.Show the component.Parameters:

animation : Object/String/Boolean

(optional) Defaults to false.

Returns:

void

Component

 

showBy( Mixed alignTo, Object/String/Boolean animation, Boolean allowOnSide ) : voidShow this component relative another component or element.Show this component relative another component or element.Parameters:

alignTo : Mixed

Element or Component

animation : Object/String/Boolean allowOnSide : Boolean

true to allow this element to be aligned on the left or right.

Returns:

void

Component

Page 99: Class Ext.form.Formpanel

 

showMask( String/Object cfg, String/Element target ) : Ext.form.FormPanelShows a generic/custom mask over a designated Element.Shows a generic/custom mask over a designated Element.Parameters:

cfg : String/Object

Either a string message or a configuration object supporting the following options:

{ message : 'Please Wait', transparent : false, target : Ext.getBody(), //optional target Element cls : 'form-mask', customImageUrl : 'trident.jpg' }

This object is passed to the waitTpl for use with a custom masking implementation.

target : String/Element

The target Element instance or Element id to use as the masking agent for the operation (defaults the container Element of the component)

Returns:

Ext.form.FormPanel

this

FormPanel

 submit( Object options ) : Ext.data.ConnectionPerforms a Ajax-based submission of form values (if standardSubmit is false) or otherwise executes a standard HTML F...Performs a Ajax-based submission of form values (if standardSubmit is false) or otherwise executes a standard HTML Form submit action.Parameters:

options : Object

Unless otherwise noted, options may include the following:

o url : String

The url for the action (defaults to the form's url.)

o method : String

The form method to use (defaults to the form's method, or POST if not defined)

FormPanel

Page 100: Class Ext.form.Formpanel

o params : String/Object

The params to pass (defaults to the FormPanel's baseParams, or none if not defined) Parameters are encoded as standard HTTP parameters using Ext.urlEncode.

o headers : Object

Request headers to set for the action (defaults to the form's default headers)

o autoAbort : Boolean

true to abort any pending Ajax request prior to submission (defaults to false) Note: Has no effect when standardSubmit is enabled.

o submitDisabled : Boolean

true to submit all fields regardless of disabled state (defaults to false) Note: Has no effect when standardSubmit is enabled.

o waitMsg : String/Config

If specified, the value is applied to the waitTpl if defined, and rendered to the waitMsgTarget prior to a Form submit action.

o success : Function

The callback that will be invoked after a successful response. A response is successful if a response is received from the server and is a JSON object where the success property is set to true, {"success": true} The function is passed the following parameters:

form : Ext.FormPanel The form that requested the action result : The result object returned by the server as a result of the submit

request.o failure : Function

The callback that will be invoked after a failed transaction attempt. The function is passed the following parameters:

form : The Ext.FormPanel that requested the submit. result : The failed response or result object returned by the server

which performed the operation.o scope : Object

The scope in which to call the callback functions (The this reference for the

Page 101: Class Ext.form.Formpanel

callback functions).

Returns:

Ext.data.Connection

request Object

 

suspendEvents( Boolean queueSuspended ) : voidSuspend the firing of all events. (see resumeEvents)Suspend the firing of all events. (see resumeEvents)Parameters:

queueSuspended : Boolean

Pass as true to queue up suspended events to be fired after the resumeEvents call instead of discarding all suspended events;

Returns:

void

Observable

 

un( String eventName, Function handler, [Object scope] ) : voidRemoves an event handler (shorthand for removeListener.)Removes an event handler (shorthand for removeListener.)Parameters:

eventName : String

The type of event the handler was associated with.

handler : Function

The handler to remove. This must be a reference to the function passed into the addListener call.

scope : Object

(optional) The scope originally specified for the handler.

Returns:

void

Observable

 up( String selector ) : Ext.ContainerWalks up the ownerCt axis looking for an ancestor Container which matches the passed simple selector. Example:var own...

Component

Page 102: Class Ext.form.Formpanel

Walks up the ownerCt axis looking for an ancestor Container which matches the passed simple selector.

Example:

var owningTabContainer = grid.up('tabcontainer');

Parameters:

selector : String

Optional. The simple selector to test.

Returns:

Ext.Container

The matching ancestor Container (or <code>undefined</code> if no match was found).

 

update( Mixed htmlOrData, [Boolean loadScripts], [Function callback] ) : voidUpdate the content area of a component.Update the content area of a component.Parameters:

htmlOrData : Mixed

If this component has been configured with a template via the tpl config then it will use this argument as data to populate the template. If this component was not configured with a template, the components content area will be updated via Ext.Element update

loadScripts : Boolean

(optional) Only legitimate when using the html configuration. Defaults to false

callback : Function

(optional) Only legitimate when using the html configuration. Callback to execute when scripts have finished loading

Returns:

void

Component

 updateRecord( Ext.data.Model instance, Boolean enabled ) : Ext.form.FormPanelUpdates a model instance with the current values of this formUpdates a model instance with the current values of this formParameters:

FormPanel

Page 103: Class Ext.form.Formpanel

instance : Ext.data.Model

The model instance

enabled : Boolean

true to update the Model with values from enabled fields only

Returns:

Ext.form.FormPanel

this

Public Events

EventDefined

By

 

activate : ( Ext.Component this ) Fires after a Component has been visually activated.Fires after a Component has been visually activated.Listeners will be called with the following arguments:

this : Ext.Component

Component

 

add : ( Ext.Container this, Ext.Component component, Number index ) Listeners will be called with the following arguments:

this : Ext.Container component : Ext.Component

The component that was added

index : Number

The index at which the component was added to the container's items collection

Container

 added : ( Ext.Component this, Ext.Container container, Number pos ) Fires after a Component had been added to a Container.Fires after a Component had been added to a Container.Listeners will be called with the following arguments:

this : Ext.Component container : Ext.Container

Parent Container

Component

Page 104: Class Ext.form.Formpanel

pos : Number

position of Component

 

afterlayout : ( Ext.Container this, ContainerLayout layout ) Fires when the components in this container are arranged by the associated layout manager.Fires when the components in this container are arranged by the associated layout manager.Listeners will be called with the following arguments:

this : Ext.Container layout : ContainerLayout

The ContainerLayout implementation for this container

Container

 

afterrender : ( Ext.Component this ) Fires after the component rendering is finished. The afterrender event is fired after this Component has been rendere...

Fires after the component rendering is finished.

The afterrender event is fired after this Component has been rendered, been postprocesed by any afterRender method defined for the Component, and, if stateful, after state has been restored.

Listeners will be called with the following arguments:

this : Ext.Component

Component

 

beforeactivate : ( Ext.Component this ) Fires before a Component has been visually activated. Returning false from an event listener can prevent the activate...Fires before a Component has been visually activated. Returning false from an event listener can prevent the activate from occurring.Listeners will be called with the following arguments:

this : Ext.Component

Component

 beforeadd : ( Ext.Container this, Ext.Component component, Number index ) Fires before any Ext.Component is added or inserted into the container. A handler can return false to cancel the add.Fires before any Ext.Component is added or inserted into the container. A handler can return false to cancel the add.Listeners will be called with the following arguments:

this : Ext.Container component : Ext.Component

The component being added

Container

Page 105: Class Ext.form.Formpanel

index : Number

The index at which the component will be added to the container's items collection

 

beforecardswitch : ( Ext.Container this, Ext.Component newCard, Ext.Component oldCard, Number index, Boolean animated ) Fires before this container switches the active card. This event is only available if this container uses a CardLayou...Fires before this container switches the active card. This event is only available if this container uses a CardLayout. Note that TabPanel and Carousel both get a CardLayout by default, so both will have this event. A handler can return false to cancel the card switch.Listeners will be called with the following arguments:

this : Ext.Container newCard : Ext.Component

The card that will be switched to

oldCard : Ext.Component

The card that will be switched from

index : Number

The index of the card that will be switched to

animated : Boolean

True if this cardswitch will be animated

Container

 

beforedeactivate : ( Ext.Component this ) Fires before a Component has been visually deactivated. Returning false from an event listener can prevent the deacti...Fires before a Component has been visually deactivated. Returning false from an event listener can prevent the deactivate from occurring.Listeners will be called with the following arguments:

this : Ext.Component

Component

 

beforedestroy : ( Ext.Component this ) Fires before the component is destroyed. Return false from an event handler to stop the destroy.Fires before the component is destroyed. Return false from an event handler to stop the destroy.Listeners will be called with the following arguments:

this : Ext.Component

Component

Page 106: Class Ext.form.Formpanel

 

beforehide : ( Ext.Component this ) Fires before the component is hidden when calling the hide method. Return false from an event handler to stop the hid...Fires before the component is hidden when calling the hide method. Return false from an event handler to stop the hide.Listeners will be called with the following arguments:

this : Ext.Component

Component

 

beforeorientationchange : ( Ext.Panel this, String orientation, Number width, Number height ) Fires before the orientation changes, if the monitorOrientation configuration is set to true. Return false to stop th...Fires before the orientation changes, if the monitorOrientation configuration is set to true. Return false to stop the orientation change.Listeners will be called with the following arguments:

this : Ext.Panel orientation : String

'landscape' or 'portrait'

width : Number height : Number

Component

 

beforeremove : ( Ext.Container this, Ext.Component component ) Fires before any Ext.Component is removed from the container. A handler can return false to cancel the remove.Fires before any Ext.Component is removed from the container. A handler can return false to cancel the remove.Listeners will be called with the following arguments:

this : Ext.Container component : Ext.Component

The component being removed

Container

 

beforerender : ( Ext.Component this ) Fires before the component is rendered. Return false from an event handler to stop the render.Fires before the component is rendered. Return false from an event handler to stop the render.Listeners will be called with the following arguments:

this : Ext.Component

Component

 beforeshow : ( Ext.Component this ) Fires before the component is shown when calling the show method. Return false from an event handler to stop the show...

Component

Page 107: Class Ext.form.Formpanel

Fires before the component is shown when calling the show method. Return false from an event handler to stop the show.Listeners will be called with the following arguments:

this : Ext.Component

 

beforesubmit : ( Ext.FormPanel this, Object values, Object options ) Fires immediately preceding any Form submit action. Implementations may adjust submitted form values or options prior...Fires immediately preceding any Form submit action. Implementations may adjust submitted form values or options prior to execution. A return value of false from this listener will abort the submission attempt (regardless of standardSubmit configuration)Listeners will be called with the following arguments:

this : Ext.FormPanel

This FormPanel

values : Object

A hash collection of the qualified form values about to be submitted

options : Object

Submission options hash (only available when standardSubmit is false)

FormPanel

 

bodyresize : ( Ext.Panel p, Number width, Number height ) Fires after the Panel has been resized.Fires after the Panel has been resized.Listeners will be called with the following arguments:

p : Ext.Panel

the Panel which has been resized.

width : Number

The Panel body's new width.

height : Number

The Panel body's new height.

Panel

 cardswitch : ( Ext.Container this, Ext.Component newCard, Ext.Component oldCard, Number index, Boolean animated ) Fires after this container switches the active card. If the card is switched using an animation, this event will fire...Fires after this container switches the active card. If the card is switched using an animation, this event will fire after the animation has finished. This event is only available if this

Container

Page 108: Class Ext.form.Formpanel

container uses a CardLayout. Note that TabPanel and Carousel both get a CardLayout by default, so both will have this event.Listeners will be called with the following arguments:

this : Ext.Container newCard : Ext.Component

The card that has been switched to

oldCard : Ext.Component

The card that has been switched from

index : Number

The index of the card that has been switched to

animated : Boolean

True if this cardswitch was animated

 

deactivate : ( Ext.Component this ) Fires after a Component has been visually deactivated.Fires after a Component has been visually deactivated.Listeners will be called with the following arguments:

this : Ext.Component

Component

 

destroy : ( Ext.Component this ) Fires after the component is destroyed.Fires after the component is destroyed.Listeners will be called with the following arguments:

this : Ext.Component

Component

 

disable : ( Ext.Component this ) Fires after the component is disabled.Fires after the component is disabled.Listeners will be called with the following arguments:

this : Ext.Component

Component

 

enable : ( Ext.Component this ) Fires after the component is enabled.Fires after the component is enabled.Listeners will be called with the following arguments:

this : Ext.Component

Component

Page 109: Class Ext.form.Formpanel

 

exception : ( Ext.FormPanel this, Object result ) Fires when either the Ajax HTTP request reports a failure OR the server returns a success:false response in the resul...Fires when either the Ajax HTTP request reports a failure OR the server returns a success:false response in the result payload.Listeners will be called with the following arguments:

this : Ext.FormPanel

This FormPanel

result : Object

Either a failed Ext.data.Connection request object or a failed (logical) server response payload.

FormPanel

 

hide : ( Ext.Component this ) Fires after the component is hidden. Fires after the component is hidden when calling the hide method.Fires after the component is hidden. Fires after the component is hidden when calling the hide method.Listeners will be called with the following arguments:

this : Ext.Component

Component

 

move : ( Ext.Component this, Number x, Number y ) Fires after the component is moved.Fires after the component is moved.Listeners will be called with the following arguments:

this : Ext.Component x : Number

The new x position

y : Number

The new y position

Component

 orientationchange : ( Ext.Panel this, String orientation, Number width, Number height ) Fires when the orientation changes, if the monitorOrientation configuration is set to true.Fires when the orientation changes, if the monitorOrientation configuration is set to true.Listeners will be called with the following arguments:

this : Ext.Panel orientation : String

'landscape' or 'portrait'

Component

Page 110: Class Ext.form.Formpanel

width : Number height : Number

 

remove : ( Ext.Container this, Ext.Component component ) Listeners will be called with the following arguments:

this : Ext.Container component : Ext.Component

The component that was removed

Container

 

removed : ( Ext.Component this, Ext.Container ownerCt ) Fires when a component is removed from an Ext.ContainerFires when a component is removed from an Ext.ContainerListeners will be called with the following arguments:

this : Ext.Component ownerCt : Ext.Container

Container which holds the component

Component

 

render : ( Ext.Component this ) Fires after the component markup is rendered.Fires after the component markup is rendered.Listeners will be called with the following arguments:

this : Ext.Component

Component

 resize : ( Ext.Component this, Number adjWidth, Number adjHeight, Number rawWidth, Number rawHeight ) Fires after the component is resized.Fires after the component is resized.Listeners will be called with the following arguments:

this : Ext.Component adjWidth : Number

The box-adjusted width that was set

adjHeight : Number

The box-adjusted height that was set

rawWidth : Number

The width that was originally specified

Component

Page 111: Class Ext.form.Formpanel

rawHeight : Number

The height that was originally specified

 

show : ( Ext.Component this ) Fires after the component is shown when calling the show method.Fires after the component is shown when calling the show method.Listeners will be called with the following arguments:

this : Ext.Component

Component

 

submit : ( Ext.FormPanel this, Object result ) Fires upon successful (Ajax-based) form submissionFires upon successful (Ajax-based) form submissionListeners will be called with the following arguments:

this : Ext.FormPanel

This FormPanel

result : Object

The result object as returned by the server

FormPanel