For up to date documentation and features, visit http://docs.sencha.com/ext-js/4-0

## Sencha Documentation

# Ext.util.Floating

A mixin to add floating capability to a Component

Defined By

### Config Options

#### Other Configs

Ext.util.Floating
view source
focusOnToFront : Boolean
Specifies whether the floated component should be automatically focused when it is brought to the front. Defaults to ...

Specifies whether the floated component should be automatically focused when it is brought to the front. Defaults to true.

Ext.util.Floating
view source
shadow : String/Boolean
Specifies whether the floating component should be given a shadow. Set to true to automatically create an Ext.Shadow,...

Specifies whether the floating component should be given a shadow. Set to `true` to automatically create an Ext.Shadow, or a string indicating the shadow's display Ext.Shadow.mode. Set to `false` to disable the shadow. (Defaults to `'sides'`.)

Defined By

### Methods

Ext.util.Floating
view source
alignTo( Mixed element, String position, [Array offsets]) : Component

Aligns this floating Component to the specified element

Aligns this floating Component to the specified element

### Parameters

- element : Mixed

  The element or Ext.Component to align to. If passing a component, it must be a omponent instance. If a string id is passed, it will be used as an element id.

- position : String

  (optional, defaults to "tl-bl?") The position to align to (see Ext.core.Element.alignTo for more details).

- offsets : Array

  (optional) Offset the positioning by [x, y]

### Returns

- Component

  this

Ext.util.Floating
view source
center : Component

Center this Component in its container.

Center this Component in its container.

### Returns

- Component

  this

Ext.util.Floating
view source
doConstrain( Mixed constrainTo) : void
Moves this floating Component into a constrain region. By default, this Component is constrained to be within the c...

Moves this floating Component into a constrain region.

By default, this Component is constrained to be within the container it was added to, or the element it was rendered to.

An alternative constraint may be passed.

### Parameters

- constrainTo : Mixed

  Optional. The Element or Region into which this Component is to be constrained.

### Returns

- void

Ext.util.Floating
view source
setActive( Boolean active, Component newActive) : void
This method is called internally by Ext.ZIndexManager to signal that a floating Component has either been moved to th...

This method is called internally by Ext.ZIndexManager to signal that a floating Component has either been moved to the top of its zIndex stack, or pushed from the top of its zIndex stack.

If a Window is superceded by another Window, deactivating it hides its shadow.

This method also fires the activate or deactivate event depending on which action occurred.

### Parameters

- active : Boolean

  True to activate the Component, false to deactivate it (defaults to false)

- newActive : Component

  The newly active Component which is taking over topmost zIndex position.

### Returns

- void

Ext.util.Floating
view source
toBack : Component

Sends this Component to the back of (lower z-index than) any other visible windows

Sends this Component to the back of (lower z-index than) any other visible windows

### Returns

- Component

  this

Ext.util.Floating
view source
toFront( [Boolean preventFocus]) : Component
Brings this floating Component to the front of any other visible, floating Components managed by the same ZIndexManag...

Brings this floating Component to the front of any other visible, floating Components managed by the same ZIndexManager

If this Component is modal, inserts the modal mask just below this Component in the z-index stack.

### Parameters

- preventFocus : Boolean

  (optional) Specify `true` to prevent the Component from being focused.

### Returns

- Component

  this