X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..ddde20c4d4ac6a8d53de079761155de813845b3c:/docs/output/Ext.Viewport.html diff --git a/docs/output/Ext.Viewport.html b/docs/output/Ext.Viewport.html index b36369cf..05756614 100644 --- a/docs/output/Ext.Viewport.html +++ b/docs/output/Ext.Viewport.html @@ -1,64 +1,64 @@ -
Observable Component BoxComponent Container Viewport
Package: | Ext |
Defined In: | Viewport.js |
Class: | Viewport |
Extends: | Container |
xtype: | viewport |
A specialized container representing the viewable application area (the browser viewport).
-The Viewport renders itself to the document body, and automatically sizes itself to the size of -the browser viewport and manages window resizing. There may only be one Viewport created -in a page. Inner layouts are available by virtue of the fact that all Panels -added to the Viewport, either through its items, or through the items, or the add -method of any of its child Panels may themselves have a layout.
-The Viewport does not provide scrolling, so child Panels within the Viewport should provide -for scrolling if needed using the autoScroll config.
-An example showing a classic application border layout:
new Ext.Viewport({
- layout: 'border',
- items: [{
- region: 'north',
- html: '<h1 class="x-panel-header">Page Title</h1>',
- autoHeight: true,
- border: false,
- margins: '0 0 5 0'
- }, {
- region: 'west',
- collapsible: true,
- title: 'Navigation',
- width: 200
- // the west region might typically utilize a TreePanel or a Panel with Accordion layout
- }, {
- region: 'south',
- title: 'Title for Panel',
- collapsible: true,
- html: 'Information goes here',
- split: true,
- height: 100,
- minHeight: 100
- }, {
- region: 'east',
- title: 'Title for the Grid Panel',
- collapsible: true,
- split: true,
- width: 200,
- xtype: 'grid',
- // remaining grid configuration not shown ...
- // notice that the GridPanel is added directly as the region
- // it is not "overnested" inside another Panel
- }, {
- region: 'center',
- xtype: 'tabpanel', // TabPanel itself has no title
- items: {
- title: 'Default Tab',
- html: 'The first tab\'s content. Others may be added dynamically'
- }
- }]
+Observable
Component
BoxComponent
Container
Viewport
Class Ext.Viewport
Package: Ext Defined In: Viewport.js Class: Viewport Extends: Container
A specialized container representing the viewable application area (the browser viewport).
+The Viewport renders itself to the document body, and automatically sizes itself to the size of
+the browser viewport and manages window resizing. There may only be one Viewport created
+in a page. Inner layouts are available by virtue of the fact that all Panels
+added to the Viewport, either through its items, or through the items, or the add
+method of any of its child Panels may themselves have a layout.
+The Viewport does not provide scrolling, so child Panels within the Viewport should provide
+for scrolling if needed using the autoScroll config.
+An example showing a classic application border layout:
new Ext.Viewport({
+ layout: 'border',
+ items: [{
+ region: 'north',
+ html: '<h1 class="x-panel-header">Page Title</h1>',
+ autoHeight: true,
+ border: false,
+ margins: '0 0 5 0'
+ }, {
+ region: 'west',
+ collapsible: true,
+ title: 'Navigation',
+ width: 200
+ // the west region might typically utilize a TreePanel or a Panel with Accordion layout
+ }, {
+ region: 'south',
+ title: 'Title for Panel',
+ collapsible: true,
+ html: 'Information goes here',
+ split: true,
+ height: 100,
+ minHeight: 100
+ }, {
+ region: 'east',
+ title: 'Title for the Grid Panel',
+ collapsible: true,
+ split: true,
+ width: 200,
+ xtype: 'grid',
+ // remaining grid configuration not shown ...
+ // notice that the GridPanel is added directly as the region
+ // it is not "overnested" inside another Panel
+ }, {
+ region: 'center',
+ xtype: 'tabpanel', // TabPanel itself has no title
+ items: {
+ title: 'Default Tab',
+ html: 'The first tab\'s content. Others may be added dynamically'
+ }
+ }]
});
Config Options
Config Options Defined 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.AccordionLayout, Ext.layout.CardLayout and
-Ext.layout.FitLayout). Related to Ext.layout.ContainerLayout.activeItem. Container anchor : StringNote: this config is only used when this Component is rendered
+Ext.layout.FitLayout). Related to Ext.layout.ContainerLayout.activeItem. Container anchor : StringNote: this config is only used when this Component is rendered
by a Container which has been configured to use an Anc...Note: this config is only used when this Component is rendered
-by a Container which has been configured to use an AnchorLayout
+by a Container which has been configured to use an AnchorLayout (or subclass thereof).
based layout manager, for example:
- Ext.form.FormPanel
- specifying
layout: 'anchor' // or 'form', or 'absolute'
-See Ext.layout.AnchorLayout.anchor also.
Component autoDestroy : BooleanIf true the container will automatically destroy any contained component that is removed from it, else
+See Ext.layout.AnchorLayout.anchor also.
BoxComponent 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 autoEl : MixedA tag name or DomHelper spec used to create the Element which will
encapsulate this Component.
@@ -89,12 +89,25 @@ different DOM elements. Example usage:{
autoEl: 'li',
html: 'First list item'
}
-}
Component autoShow : BooleanTrue if the component should check for hidden classes (e.g. 'x-hidden' or 'x-hide-display') and remove
+} Component autoScroll : Booleantrue to use overflow:'auto' on the components layout element and show scroll bars automatically when
+necessary, false...true
to use overflow:'auto' on the components layout element and show scroll bars automatically when
+necessary, false
to clip any overflowing content (defaults to false
). BoxComponent autoShow : BooleanTrue if the component should check for hidden classes (e.g. 'x-hidden' or 'x-hide-display') and remove
them on render...True if the component should check for hidden classes (e.g. 'x-hidden' or 'x-hide-display') and remove
-them on render (defaults to false). Component bufferResize : Boolean/NumberWhen set to true (100 milliseconds) or a number of milliseconds, the layout assigned for this container will buffer
-t...When set to true (100 milliseconds) or a number of milliseconds, the layout assigned for this container will buffer
+them on render (defaults to false). Component boxMaxHeight : NumberThe maximum value in pixels which this BoxComponent will set its height to.
+Warning: This will override any size mana...The maximum value in pixels which this BoxComponent will set its height to.
+Warning: This will override any size management applied by layout managers.
BoxComponent boxMaxWidth : NumberThe maximum value in pixels which this BoxComponent will set its width to.
+Warning: This will override any size manag...The maximum value in pixels which this BoxComponent will set its width to.
+Warning: This will override any size management applied by layout managers.
BoxComponent boxMinHeight : NumberThe minimum value in pixels which this BoxComponent will set its height to.
+Warning: This will override any size mana...The minimum value in pixels which this BoxComponent will set its height to.
+Warning: This will override any size management applied by layout managers.
BoxComponent boxMinWidth : NumberThe minimum value in pixels which this BoxComponent will set its width to.
+Warning: This will override any size manag...The minimum value in pixels which this BoxComponent will set its width to.
+Warning: This will override any size management applied by layout managers.
BoxComponent 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 bufferResize : Boolean/NumberWhen set to true (50 milliseconds) or a number of milliseconds, the layout assigned for this container will buffer
+th...When set to true (50 milliseconds) or a number of milliseconds, the layout assigned for this container will buffer
the frequency it calculates and does a re-layout of components. This is useful for heavy containers or containers
-with a large quantity of sub-components for which frequent layout calls would be expensive. Container clearCls : StringThe CSS class used to to apply to the special clearing div rendered
+with a large quantity of sub-components for which frequent layout calls would be expensive. Defaults to 50
. Container clearCls : StringThe CSS class used to to apply to the special clearing div rendered
directly after each form field wrapper to provide...The CSS class used to to apply to the special clearing div rendered
directly after each form field wrapper to provide field clearing (defaults to
'x-form-clear-left').
@@ -104,7 +117,21 @@ manager (e.g. fieldLabel is specified or isFormField=true is specified.
See Ext.layout.FormLayout.fieldTpl also.
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 ctCls : StringAn optional extra CSS class that will be added to this component's container. This can be useful for
+useful for adding customized styles to the component or any of its children using standard CSS rules. 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 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.
+
Component ctCls : StringAn optional extra CSS class that will be added to this component's container. This can be useful for
adding customize...An optional extra CSS class that will be added to this component's container. This can be useful for
adding customized styles to the container or any of its children using standard CSS rules. See
Ext.layout.ContainerLayout.extraCls also.
@@ -115,18 +142,23 @@ which assigns a value by default:
To configure the above Class with an extra CSS class append to the default. For example,
for BoxLayout (Hbox and Vbox):ctCls: 'x-box-layout-ct custom-class'
- Component defaultType : StringThe default xtype of child Components to create in this Container when
+ Component 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', except Ext.menu.Menu which defaults to 'menuitem',
-and Ext.Toolbar and Ext.ButtonGroup which default to 'button'.
Container defaults : ObjectA config object that will be applied to all components added to this container either via the items
-config or via the...A config object that will be applied to all components added to this container either via the items
-config or via the add or insert methods. The defaults config can contain any
-number of name/value property pairs to be added to each item, and should be valid for the types of items
-being added to the container. 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'}.
-Note: defaults will not be applied to config objects if the option is already specified.
-For example:
defaults: { // defaults are applied to items, not the container
+Defaults to 'panel'
, except Ext.menu.Menu which defaults to 'menuitem'
,
+and Ext.Toolbar and Ext.ButtonGroup which default to 'button'
.
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 Ext.Panel items, you could pass: defaults: {bodyStyle:'padding:15px'}
.
+Usage:
defaults: { // defaults are applied to items, not the container
autoScroll:true
},
items: [
@@ -153,7 +185,13 @@ Example use:new Ext.FormPanel({
xtype: 'textfield',
fieldLabel: 'Name'
}]
-});
Component forceLayout : BooleanIf true the container will force a layout initially even if hidden or collapsed. This option
+}); Component flex : NumberNote: this config is only used when this Component is rendered
+by a Container which has been configured to use a BoxL...Note: this config is only used when this Component is rendered
+by a Container which has been configured to use a BoxLayout.
+Each child Component with a flex
property will be flexed either vertically (by a VBoxLayout)
+or horizontally (by an HBoxLayout) according to the item's relative flex
value
+compared to the sum of all Components with flex value specified. Any child items that have
+either a flex = 0
or flex = undefined
will not be 'flexed' (the initial size will not be changed).
BoxComponent forceLayout : BooleanIf true the container will force a layout initially even if hidden or collapsed. This option
is useful for forcing fo...If true the container will force a layout initially even if hidden or collapsed. This option
is useful for forcing forms to render in collapsed or hidden containers. (defaults to false). Container hidden : BooleanRender this component hidden (default is false). If true, the
hide method will be called internally. Component hideBorders : BooleanTrue to hide the borders of each contained component, false to defer to the component's existing
@@ -179,7 +217,11 @@ Example use:new Ext.FormPanel({
(css display).
Note: the default of 'display' is generally preferred
since items are automatically laid out when they are first shown (no sizing
-is done while hidden).
Component id : StringThe unique id of this component (defaults to an auto-assigned id).
+is done while hidden). 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 id : StringThe unique id of this component (defaults to an auto-assigned id).
You should assign an id if you need to be able to ...The unique id of this component (defaults to an auto-assigned id).
You should assign an id if you need to be able to access the component later and you do
not have an object reference available (e.g., using Ext.getCmp).
@@ -189,8 +231,11 @@ rules to style the specific instance of this component uniquely, and also to sel
sub-elements using this component's id as the parent.
Note: to avoid complications imposed by a unique id also see
itemId
and ref
.
-Note: to access the container of an item see ownerCt
.
Component itemCls : StringAn additional CSS class to apply to the div wrapping the form item
-element of this field. If supplied, itemCls at th...An additional CSS class to apply to the div wrapping the form item
+
Note: to access the container of an item see ownerCt
.
Component itemCls : StringNote: this config is only used when this Component is rendered by a Container which
+has been configured to use the Fo...Note: this config is only used when this Component is rendered by a Container which
+has been configured to use the FormLayout layout manager (e.g.
+Ext.form.FormPanel or specifying layout:'form').
+An additional CSS class to apply to the div wrapping the form item
element of this field. If supplied, itemCls at the field level will override
the default itemCls supplied at the container level. The value specified for
itemCls will be added to the default class ('x-form-item').
@@ -199,22 +244,22 @@ the default itemCls supplied at the container level. The value s
you to write standard CSS rules that can apply to the field, the label (if specified), or
any other element within the markup for the field.
Note: see the note for fieldLabel.
-Example use:// Apply a style to the field's label:
+Example use:// Apply a style to the field's label:
<style>
.required .x-form-item-label {font-weight:bold;color:red;}
</style>
new Ext.FormPanel({
- height: 100,
- renderTo: Ext.getBody(),
- items: [{
- xtype: 'textfield',
- fieldLabel: 'Name',
- itemCls: 'required' //this label will be styled
- },{
- xtype: 'textfield',
- fieldLabel: 'Favorite Color'
- }]
+ height: 100,
+ renderTo: Ext.getBody(),
+ items: [{
+ xtype: 'textfield',
+ fieldLabel: 'Name',
+ itemCls: 'required' //this label will be styled
+ },{
+ xtype: 'textfield',
+ fieldLabel: 'Favorite Color'
+ }]
});
Component itemId : StringAn itemId can be used as an alternative way to get a reference to a component
when no object reference is available. ...An itemId can be used as an alternative way to get a reference to a component
when no object reference is available. Instead of using an id
with
@@ -335,7 +380,7 @@ you have in mind. For example:
new Ext.Window({
}]
}).show();
If the layout configuration is not explicitly specified for
-a general purpose container (e.g. Container or Panel) the
+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).
@@ -353,30 +398,30 @@ as a String:
padding: '5',
align: 'left'
}
-- type
+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:
+
Valid layout type
values are:
- 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
+each layout type, see the layout class corresponding to the type
specified.
Specify as a String
@@ -387,13 +432,13 @@ layoutConfig: {
padding: '5',
align: 'left'
}
-layout
-
The layout type to be used for this container (see list
+
layout
+
The layout type
to be used for this container (see list
of valid layout type values above).
-layoutConfig
+layoutConfig
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.
+layout class corresponding to the layout
specified.
Container layoutConfig : Object Container listeners : ObjectA config object containing one or more event handlers to be added to this
@@ -489,9 +534,9 @@ object. The ptype will be looked up at render time up to determine
type of Plugin to create.
If you create your own Plugins, you may register them using
Ext.ComponentMgr.registerPlugin in order to be able to
-take advantage of lazy instantiation and rendering. Component ref : StringA path specification, relative to the Component's ownerCt specifying into which
-ancestor Container to place a named r...A path specification, relative to the Component's ownerCt specifying into which
-ancestor Container to place a named reference to this Component.
+take advantage of lazy instantiation and rendering. Component ref : StringA path specification, relative to the Component's ownerCt
+specifying into which ancestor Container to place a named r...A path specification, relative to the Component's ownerCt
+specifying into which ancestor Container to place a named reference to this Component.
The ancestor axis can be traversed by using '/' characters in the path.
For example, to put a reference to a Toolbar Button into the Panel which owns the Toolbar:
var myGrid = new Ext.grid.EditorGridPanel({
title: 'My EditorGridPanel',
@@ -510,13 +555,14 @@ For example, to put a reference to a Toolbar Button into the Panel which owns
}
}
});
-In the code above, if the ref had been 'saveButton'
the reference would
-have been placed into the Toolbar. Each '/' in the ref moves up one level from the
-Component's ownerCt.
Component region : String Component region : StringNote: this config is only used when this BoxComponent is rendered
by a Container which has been configured to use the...Note: this config is only used when this BoxComponent is rendered
by a Container which has been configured to use the BorderLayout
layout manager (e.g. specifying layout:'border').
-See Ext.layout.BorderLayout also.
BoxComponent stateEvents : ArrayAn array of events that, when fired, should trigger this component to
+See Ext.layout.BorderLayout also.
BoxComponent resizeEvent : StringThe event to listen to for resizing in layouts. Defaults to 'resize'
. Container stateEvents : ArrayAn array of events that, when fired, should trigger this component to
save its state (defaults to none). stateEvents ...An array of events that, when fired, should trigger this component to
save its state (defaults to none). stateEvents
may be any type
of event supported by this component, including browser or custom events
@@ -586,7 +632,20 @@ Ext.Element.ap...
A custom style specification to be appl
}
})
]
-}); Component x : NumberThe local x (left) coordinate for this component if contained within a positioning container. BoxComponent xtype : StringThe registered xtype to create. This config option is not used when passing
+}); Component tabTip : StringNote: this config is only used when this BoxComponent is a child item of a TabPanel.
+A string to be used as innerHTML...Note: this config is only used when this BoxComponent is a child item of a TabPanel.
+A string to be used as innerHTML (html tags are accepted) to show in a tooltip when mousing over
+the associated tab selector element. Ext.QuickTips.init()
+must be called in order for the tips to render. BoxComponent 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 x : NumberThe local x (left) coordinate for this component if contained within a positioning container. BoxComponent xtype : StringThe registered xtype to create. This config option is not used when passing
a config object into a constructor. This ...The registered xtype to create. This config option is not used when passing
a config object into a constructor. This config option is used only when
lazy instantiation is being used, and a child item of a Container is being
@@ -614,13 +673,17 @@ config for a suggestion, or use a render listener directly:new
single: true // Remove the listener after first invocation
}
});
-See also getEl
Component hidden : BooleanTrue if this component is hidden. Read-only. Component initialConfig : ObjectThis Component's initial configuration specification. Read-only. Component items : MixedCollectionThe collection of components in this container as a Ext.util.MixedCollection Container ownerCt : Ext.ContainerThe component's owner Ext.Container (defaults to undefined, and is set automatically when
-the component is added to a...The component's owner Ext.Container (defaults to undefined, and is set automatically when
-the component is added to a container). Read-only.
-Note: to access items within the container see itemId.
Component rendered : BooleanTrue if this component has been rendered. Read-only. Component
Public Methods
Method Defined By Viewport( Object config
)
- Create a new ViewportCreate a new ViewportParameters:config
: ObjectThe config object
Returns:- void
xtype: viewport
Viewport add( Object/Array component
, Object (Optional)
, Object (Optional)
)
- :
- Ext.ComponentAdds Component(s) to this Container.
+See also getEl
Component hidden : BooleanTrue if this component is hidden. Read-only. Component initialConfig : ObjectThis Component's initial configuration specification. Read-only. Component items : MixedCollectionThe collection of components in this container as a Ext.util.MixedCollection Container ownerCt : Ext.ContainerThis Component's owner Container (defaults to undefined, and is set automatically when
+this Component is added to a C... Component private : ObjectWe can only lay out if there is a view area in which to layout.
+display:none on the layout target, *or any of its par...We can only lay out if there is a view area in which to layout.
+display:none on the layout target, *or any of its parent elements* will mean it has no view area. Container refOwner : Ext.ContainerThe ancestor Container into which the ref reference was inserted if this Component
+is a child of a Container, and has...The ancestor Container into which the ref reference was inserted if this Component
+is a child of a Container, and has been configured with a ref
. Component rendered : BooleanTrue if this component has been rendered. Read-only. Component
Public Methods
Method Defined By Viewport( Object config
)
+ Create a new ViewportCreate a new ViewportParameters:config
: ObjectThe config object
Returns:- void
Viewport 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.
@@ -633,10 +696,10 @@ accordingly (see
-If the Container is already rendered when add
+ 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
+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')
@@ -645,12 +708,14 @@ tb.BorderLayout
for more details.
-
Parameters:component
: Object/ArrayEither a single component or an Array of components to add. See
-items
for additional information.
(Optional)
: Objectcomponent_2(Optional)
: Objectcomponent_n
Returns:Ext.Component
component The Component (or config object) that was added.
Container addClass( string cls
)
+Parameters:component
: ...Object/ArrayEither 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.
Container addClass( string cls
)
:
- Ext.ComponentAdds a CSS class to the component's underlying element.Adds a CSS class to the component's underlying element.Parameters:cls
: stringThe CSS class name to add
Returns:Ext.Component
this
Component addEvents( Object object
)
+ Ext.ComponentAdds a CSS class to the component's underlying element.Adds a CSS class to the component's underlying element.Parameters:cls
: stringThe CSS class name to add
Returns:Ext.Component
this
Component addEvents( Object|String o
, string Optional.
)
:
- voidUsed to define events on this ObservableUsed to define events on this ObservableParameters:object
: ObjectThe object with the events defined
Returns:- void
Observable addListener( String eventName
, Function handler
, [Object scope
], [Object options
] )
+ 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|StringEither 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.
: stringEvent 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:eventName
: StringThe name of the event to listen for.handler
: FunctionThe 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.
@@ -671,8 +736,8 @@ Using the options argument, it is possible to combine different types of listene
A delayed, one-time listener.
myDataView.on('click', this.onClick, this, {
- single: true,
- delay: 100
+single: true,
+delay: 100
});
Attaching multiple handlers in 1 call
@@ -680,27 +745,27 @@ The method also allows for a single argument to be passed which is a config obje
which specify multiple handlers.
myGridPanel.on({
- 'click' : {
- fn: this.onClick,
- scope: this,
- delay: 100
- },
- 'mouseover' : {
- fn: this.onMouseOver,
- scope: this
- },
- 'mouseout' : {
- fn: this.onMouseOut,
- scope: this
- }
+'click' : {
+ fn: this.onClick,
+ scope: this,
+ delay: 100
+},
+'mouseover' : {
+ fn: this.onMouseOver,
+ scope: this
+},
+'mouseout' : {
+ fn: this.onMouseOut,
+ scope: this
+}
});
Or a shorthand syntax:
myGridPanel.on({
- 'click' : this.onClick,
- 'mouseover' : this.onMouseOver,
- 'mouseout' : this.onMouseOut,
- scope: this
+'click' : this.onClick,
+'mouseover' : this.onMouseOver,
+'mouseout' : this.onMouseOut,
+ scope: this
});
Returns:- void
Observable applyToMarkup( String/HTMLElement el
)
:
voidApply this component to existing markup that is valid. With this function, no call to render() is required.Apply this component to existing markup that is valid. With this function, no call to render() is required.Parameters:el
: String/HTMLElement
Returns:- void
Component bubble( Function fn
, [Object scope
], [Array args
] )
@@ -732,9 +797,41 @@ to...Force this container's layout to be recalculated. A
to an already rendered container, or possibly after changing sizing/position properties of child components.Parameters:shallow
: Boolean(optional) True to only calc the layout of this component, and let child components auto
calc layouts as required (defaults to false, which calls doLayout recursively for each subcontainer)force
: Boolean(optional) True to force a layout to occur, even if the item is hidden.
Returns:Ext.Container
this
Container enable()
:
- Ext.ComponentEnable this component and fire the 'enable' event.Enable this component and fire the 'enable' event.Parameters:- None.
Returns:Ext.Component
this
Component enableBubble( Object events
)
- :
- voidUsed to enable bubbling of eventsUsed to enable bubbling of eventsParameters:events
: Object
Returns:- void
Observable find( String prop
, String value
)
+ Ext.ComponentEnable this component and fire the 'enable' event.Enable this component and fire the 'enable' event.Parameters:- None.
Returns:Ext.Component
this
Component 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 bubble
+ initComponent : Ext.form.Field.prototype.initComponent.createSequence(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');
+ }
+ }
+});
Parameters:events
: String/ArrayThe event name to bubble, or an Array of event names.
Returns:- void
Observable find( String prop
, String value
)
:
ArrayFind a component under this container at any level by propertyFind a component under this container at any level by propertyParameters:prop
: Stringvalue
: String
Returns:Array
Array of Ext.Components
Container findBy( Function fn
, [Object scope
] )
:
@@ -770,9 +867,9 @@ by calling Examines this container's items
property
and gets a direct child component of this container.Parameters:comp
: String/NumberThis parameter may be any of the following:
For additional information see Ext.util.MixedCollection.get.
Returns:Ext.Component
The component (if found).
Container getEl()
@@ -821,7 +918,7 @@ the element into which the Gets the current XY position of the component's underlying element.Gets the current XY position of the component's underlying element.Parameters:local
: Boolean(optional) If true the element's left and top are returned instead of page XY (defaults to false)
Returns:Array
The XY position of the element (e.g., [100, 200])
BoxComponent getResizeEl()
:
- voidReturns the outermost Element of this Component which defines the Components overall size.
+ Ext.ElementReturns the outermost Element of this Component which defines the Components overall size.
Usually this will return t...Returns the outermost Element of this Component which defines the Components overall size.
Usually this will return the same Element as getEl
,
but in some cases, a Component may have some more wrapping Elements around its main
@@ -829,7 +926,7 @@ active Element.
An example is a ComboBox. It is encased in a wrapping Element which
contains both the <input>
Element (which is what would be returned
by its getEl
method, and the trigger button Element.
-This Element is returned as the resizeEl
.
Parameters:- None.
Returns:- void
BoxComponent getSize()
+This Element is returned as the resizeEl
.Parameters:- None.
Returns:Ext.Element
The Element which is to be resized by size managing layouts.
BoxComponent getSize()
:
ObjectGets 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)}
BoxComponent getWidth()
:
@@ -886,7 +983,26 @@ to participate in determination of inherited xtypes.
var isText = t.isXType('textfield'); // true
var isBoxSubclass = t.isXType('box'); // true, descended from BoxComponent
var isBoxInstance = t.isXType('box', true); // false, not a direct BoxComponent instanceParameters:xtype
: StringThe xtype to check for this Componentshallow
: 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.
Component nextSibling()
+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.
Component mon( Observable|Element item
, Object|String ename
, Function fn
, Object scope
, Object opt
)
+ :
+ voidAdds listeners to any Observable object (or Elements) which are automatically removed when this Component
+is destroye...Adds listeners to any Observable object (or Elements) which are automatically removed when this Component
+is destroyed. Usage:
+myGridPanel.mon(myGridPanel.getSelectionModel(), 'selectionchange', handleSelectionChange, null, {buffer: 50});
+
+or:
+myGridPanel.mon(myGridPanel.getSelectionModel(), {
+ selectionchange: handleSelectionChange,
+ buffer: 50
+});
+
Parameters:item
: Observable|ElementThe item to which to add a listener/listeners.ename
: Object|StringThe event name, or an object containing event name properties.fn
: FunctionOptional. If the ename
parameter was an event name, this
+is the handler function.scope
: ObjectOptional. If the ename
parameter was an event name, this
+is the scope (this
reference) in which the handler function is executed.opt
: ObjectOptional. If the ename
parameter was an event name, this
+is the addListener options.
Returns:- void
Component mun( 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|ElementThe item from which to remove a listener/listeners.ename
: Object|StringThe event name, or an object containing event name properties.fn
: FunctionOptional. If the ename
parameter was an event name, this
+is the handler function.scope
: ObjectOptional. If the ename
parameter was an event name, this
+is the scope (this
reference) in which the handler function is executed.
Returns:- void
Component nextSibling()
:
Ext.ComponentReturns the next component in the owning containerReturns the next component in the owning containerParameters:- None.
Returns:Ext.Component
Component on( String eventName
, Function handler
, [Object scope
], [Object options
] )
:
@@ -939,12 +1055,14 @@ which this component will be inserted (defaults to appending to the end of the c
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 setDisabled( Boolean disabled
)
+events fired during event suspension will be sent to any listeners now.Parameters:- None.
Returns:- void
Observable setAutoScroll( Boolean scroll
)
:
- Ext.ComponentConvenience function for setting disabled/enabled by boolean.Convenience function for setting disabled/enabled by boolean.Parameters:disabled
: Boolean
Returns:Ext.Component
this
Component setHeight( Number height
)
+ Ext.BoxComponentSets the overflow on the content element of the component.Sets the overflow on the content element of the component.Parameters:scroll
: BooleanTrue to allow the Component to auto scroll.
Returns:Ext.BoxComponent
this
BoxComponent setDisabled( Boolean disabled
)
:
- Ext.BoxComponentSets 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
: NumberThe new height to set. This may be one of:
-- A Number specifying the new height in the Element's Ext.Element.defaultUnits (by default, pixels).
+ Ext.ComponentConvenience function for setting disabled/enabled by boolean.Convenience function for setting disabled/enabled by boolean.Parameters:disabled
: Boolean
Returns:Ext.Component
this
Component setHeight( Mixed height
)
+ :
+ Ext.BoxComponentSets 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
: MixedThe new height to set. This may be one of:
+- A Number specifying the new height in the Element's defaultUnits (by default, pixels).
- A String used to set the CSS height style.
- undefined to leave the height unchanged.
Returns:Ext.BoxComponent
this
BoxComponent setPagePosition( Number x
, Number y
)
@@ -971,10 +1089,10 @@ This may be one of:
undefined
to leave the height unchanged.
Returns:Ext.BoxComponent
this
BoxComponent 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
: BooleanTrue to show, false to hide
Returns:Ext.Component
this
Component setWidth( Number width
)
+ Ext.ComponentConvenience function to hide or show this component by boolean.Convenience function to hide or show this component by boolean.Parameters:visible
: BooleanTrue to show, false to hide
Returns:Ext.Component
this
Component setWidth( Mixed width
)
:
- Ext.BoxComponentSets 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
: NumberThe new width to setThis may be one of:
-- A Number specifying the new width in the Element's Ext.Element.defaultUnits (by default, pixels).
+ Ext.BoxComponentSets 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
: MixedThe new width to set. This may be one of:
+- A Number specifying the new width in the Element's defaultUnits (by default, pixels).
- A String used to set the CSS width style.
Returns:Ext.BoxComponent
this
BoxComponent show()
:
@@ -988,11 +1106,18 @@ after the Force the component's size to recalculate based on the underlying element's current height and width.Force the component's size to recalculate based on the underlying element's current height and width.Parameters:- None.
Returns:Ext.BoxComponent
this
BoxComponent un( String eventName
, Function handler
, [Object scope
] )
:
- voidRemoves an event handler (shorthand for removeListener.)Removes an event handler (shorthand for removeListener.)Parameters:eventName
: StringThe type of event the handler was associated with.handler
: FunctionThe 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 updateBox( Object box
)
+ voidRemoves an event handler (shorthand for removeListener.)Removes an event handler (shorthand for removeListener.)Parameters:eventName
: StringThe type of event the handler was associated with.handler
: FunctionThe 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 update( Mixed htmlOrData
, [Boolean loadScripts
], [Function callback
] )
+ :
+ voidUpdate the content area of a component.Update the content area of a component.Parameters:htmlOrData
: MixedIf 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 updateloadScripts
: Boolean(optional) Only legitimate when using the html configuration. Defaults to falsecallback
: Function(optional) Only legitimate when using the html configuration. Callback to execute when scripts have finished loading
Returns:- void
Component updateBox( Object box
)
:
Ext.BoxComponentSets the current box measurements of the component's underlying element.Sets the current box measurements of the component's underlying element.Parameters:box
: ObjectAn object in the format {x, y, width, height}
Returns:Ext.BoxComponent
this
BoxComponent
Public Events
Event Defined By add :
( Ext.Container this
, Ext.Component component
, Number index
)
- Listeners will be called with the following arguments:this
: Ext.Containercomponent
: Ext.ComponentThe component that was addedindex
: NumberThe index at which the component was added to the container's items collection
Container afterlayout :
+ Listeners will be called with the following arguments:this
: Ext.Containercomponent
: Ext.ComponentThe component that was addedindex
: NumberThe index at which the component was added to the container's items collection
Container added :
+ ( Ext.Component this
, Ext.Container ownerCt
, number index
)
+ Fires when a component is added to an Ext.ContainerFires when a component is added to an Ext.ContainerListeners will be called with the following arguments:this
: Ext.ComponentownerCt
: Ext.ContainerContainer which holds the componentindex
: numberPosition at which the component was added
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.Containerlayout
: ContainerLayoutThe ContainerLayout implementation for this container
Container afterrender :
( Ext.Component this
)
@@ -1046,7 +1171,9 @@ Fires after the component is hidden when calling the Fires after the component is moved.Fires after the component is moved.Listeners will be called with the following arguments:this
: Ext.Componentx
: NumberThe new x positiony
: NumberThe new y position
BoxComponent remove :
( Ext.Container this
, Ext.Component component
)
- Listeners will be called with the following arguments:this
: Ext.Containercomponent
: Ext.ComponentThe component that was removed
Container render :
+ Listeners will be called with the following arguments:this
: Ext.Containercomponent
: Ext.ComponentThe 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.ComponentownerCt
: Ext.ContainerContainer 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
)