Module Ext_Component


module Ext_Component: sig .. end
Base class for all Ext components.The Component ba ...

Base class for all Ext components.

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

xtypes

Every component has a specific xtype, which is its Ext-specific type name, along with methods for checking the xtype like getXType and isXType. See the Component Guide for more information on xtypes and the Component hierarchy.

Finding components

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

Additionally the Ext.ComponentQuery provides a CSS-selectors-like way to look up components by their xtype and many other attributes. For example the following code will find all textfield components inside component with id: 'myform':

Ext.ComponentQuery.query('#myform textfield');

Extending Ext.Component

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.

All user-developed visual widgets that are required to participate in automated lifecycle and size management should subclass Component.

See the Creating new UI controls chapter in Component Guide for details on how and to either extend or augment Ext JS base classes to create custom Components.

The Ext.Component class by itself

Usually one doesn't need to instantiate the Ext.Component class. There are subclasses which implement specialized use cases, covering most application needs. However it is possible to instantiate a base Component, and it can be rendered to document, or handled by layouts as the child item of a Container:

Ext.create('Ext.Component', {
    html: 'Hello world!',
    width: 300,
    height: 200,
    padding: 20,
    style: {
        color: '#FFFFFF',
        backgroundColor:'#000000'
    },
    renderTo: Ext.getBody()
});

The Component above creates its encapsulating div upon render, and use the configured HTML as content. More complex internal structure may be created using the renderTpl configuration, although to display database-derived mass data, it is recommended that an ExtJS data-backed Component such as a View, GridPanel, or TreePanel be used.

From override Ext.layout.container.border.Region: This override provides extra, border layout specific methods for Ext.Component. The Ext.layout.container.Border class requires this override so that the added functions are only included in a build when border layout is used.



class type t = object .. end
class type configs = object .. end
class type events = object .. end
class type statics = object .. end
val of_configs : configs Js.t -> t Js.t
of_configs c casts a config object c to an instance of class t
val to_configs : t Js.t -> configs Js.t
to_configs o casts instance o of class t to a config object