namespace sap.ui.core.ResizeHandler

Control sample: sap.ui.core.ResizeHandler
Visiblity: public
Available since: N/A
Module: sap/ui/core/ResizeHandler
Application Component: CA-UI5-COR

The resize handling API provides firing of resize events on all browsers by regularly checking the width and height of registered DOM elements or controls and firing events accordingly.


Nodes Overview

Node Description

Methods Overview

Method Description
sap.ui.core.ResizeHandler.deregister

Deregisters a previously registered handler for resize events with the given registration ID.

sap.ui.core.ResizeHandler.extend

Creates a new subclass of class sap.ui.core.ResizeHandler with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.Object.extend.

sap.ui.core.ResizeHandler.getMetadata

Returns a metadata object for class sap.ui.core.ResizeHandler.

sap.ui.core.ResizeHandler.register

Registers the given event handler for resize events on the given DOM element or control.

Note: This function must not be used before the UI5 framework is initialized. Please use the init event of UI5 if you are not sure whether this is the case.

The resize handler periodically checks the dimensions of the registered reference. Whenever it detects changes, an event is fired. Be careful when changing dimensions within the event handler which might cause another resize event and so on.

The available parameters of the resize event are:

  • oEvent.target: The DOM element of which the dimensions were checked
  • oEvent.size.width: The current width of the DOM element in pixels
  • oEvent.size.height: The current height of the DOM element in pixels
  • oEvent.oldSize.width: The previous width of the DOM element in pixels
  • oEvent.oldSize.height: The previous height of the DOM element in pixels
  • oEvent.control: The control which was given during registration of the event handler (if present)

sap.ui.core.ResizeHandler.deregister

Deregisters a previously registered handler for resize events with the given registration ID.

Param Type DefaultValue Description
sId string

The registration ID of the handler to deregister. The ID was provided by function sap.ui.core.ResizeHandler.register when the handler was registered.

sap.ui.core.ResizeHandler.extend

Creates a new subclass of class sap.ui.core.ResizeHandler with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.Object.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

sap.ui.core.ResizeHandler.getMetadata

Returns a metadata object for class sap.ui.core.ResizeHandler.

Param Type DefaultValue Description

sap.ui.core.ResizeHandler.register

Registers the given event handler for resize events on the given DOM element or control.

Note: This function must not be used before the UI5 framework is initialized. Please use the init event of UI5 if you are not sure whether this is the case.

The resize handler periodically checks the dimensions of the registered reference. Whenever it detects changes, an event is fired. Be careful when changing dimensions within the event handler which might cause another resize event and so on.

The available parameters of the resize event are:

Param Type DefaultValue Description
oRef Element sap.ui.core.Control

The control or the DOM reference for which the given event handler should be registered (beside the window)

fHandler function

The event handler which should be called whenever the size of the given reference is changed. The event object is passed as first argument to the event handler. See the description of this function for more details about the available parameters of this event.