Properties Methods Events Config Options Direct Link
Observable
  Component
    Component

Class Ext.Component

Package:Ext
Defined In:Component.js
Class:Component
Subclasses:Button, Carousel.Indicator, DataView, Map, Spacer, Container
Extends:Component

Base class for all Ext components. All subclasses of Component may participate in the automated Ext component lifecycle of creation, rendering and destruction which is provided by the Container class. Components may be added to a Container through the items config option at the time the Container is created, or they may be added dynamically via the add method.

The Component base class has built-in support for basic hide/show and enable/disable behavior.

All Components are registered with the Ext.ComponentMgr on construction so that they can be referenced at any time via Ext.getCmp, passing the id.

All user-developed visual widgets that are required to participate in automated lifecycle and size management should subclass Component (or Ext.BoxComponent if managed box model handling is required, ie height and width management).

See the Creating new UI controls tutorial for details on how and to either extend or augment ExtJs base classes to create custom Components.

Every component has a specific xtype, which is its Ext-specific type name, along with methods for checking the xtype like getXType and isXType. This is the list of all valid xtypes:

xtype            Class
-------------    ------------------
button           Ext.Button
component        Ext.Component
container        Ext.Container
dataview         Ext.DataView
panel            Ext.Panel
slider           Ext.form.Slider
toolbar          Ext.Toolbar
spacer           Ext.Spacer
tabpanel         Ext.TabPanel

Form components
---------------------------------------
formpanel        Ext.form.FormPanel
checkboxfield    Ext.form.Checkbox
selectfield      Ext.form.Select
field            Ext.form.Field
fieldset         Ext.form.FieldSet
hiddenfield      Ext.form.Hidden
numberfield      Ext.form.Number
radiofield       Ext.form.Radio
textareafield    Ext.form.TextArea
textfield        Ext.form.Text
togglefield      Ext.form.Toggle

Config Options

Config OptionsDefined By
 centered : Boolean
Center the Component. Defaults to false.
Component
 componentCls : String
CSS Class to be added to a components root level element to give distinction to it via styling.
Component
 data : Mixed
The initial set of data to apply to the tpl to update the content area of the Component.
Component
 disabled : Boolean
Defaults to false.
Component
 disabledCls : String
CSS class to add when the Component is disabled. Defaults to 'x-item-disabled'.
Component
 draggable : Boolean
Allows the component to be dragged via the touch event.
Component
 floating : Boolean
Create the Component as a floating and use absolute positioning. Defaults to false.
Component
 floatingCls : Boolean
The class that is being added to this component when its floating. (defaults to x-floating)
Component
 height : Number
The height of this component in pixels.
Component
 hidden : Boolean
Defaults to false.
Component
 monitorOrientation : Boolean
Monitor Orientation change
Component
 stopMaskTapEvent : Boolean
True to stop the event that fires when you click outside the floating component. Defalts to true.
Component
 styleHtmlCls : String
The class that is added to the content target when you set styleHtmlContent to true. Defaults to 'x-html'
Component
 width : Number
The width of this component in pixels.
Component

Public Properties

PropertyDefined By
 draggable : Boolean
Read-only property indicating whether or not the component can be dragged
Component
 rendered : Boolean
Read-only property indicating whether or not the component has been rendered.
Component

Public Methods

MethodDefined By

Public Events

EventDefined By