Resizable

The Resizable widget enables its content to be resizable in the UI.

Included in: dx.mobile.js, dx.web.js, dx.viz-web.js, dx.all.js
Module: ui/resizable

The Resizable widget is an element that can be resized by an end user. It displays data located inside the HTML element of the widget. You can specify minimum and maximum size using the minHeight, minWidth, maxHeight and maxWidth options. The handles option enables you to specify which element borders are used as a handle for resizing.

You can create the widget using one of the following approaches.

  • jQuery
    Use the dxResizable jQuery plug-in.

    HTML
    <div id="myResizable">
        <p>Widget content</p>
    </div>
    JavaScript
    $("#myResizable").dxResizable({
        handles: 'right bottom',
        minHeight: 100,
        minWidth: 200,
        maxHeight: 400,
        maxWidth: 300,
        height: 150,
        width: 250
    });
  • Knockout
    Add a div element and apply the dxResizable binding to this element.

    HTML
    <div data-bind="dxResizable: {
        handles: 'right bottom',
        minHeight: 100,
        minWidth: 200,
        maxHeight: 400,
        maxWidth: 300,
        height: 150,
        width: 250
    }">
        <p>Widget content</p>
    </div>
  • AngularJS
    Add a div element and apply the dx-resizable directive to this element.

    HTML
    <div dx-resizable="{
        handles: 'right bottom',
        minHeight: 100,
        minWidth: 200,
        maxHeight: 400,
        maxWidth: 300,
        height: 150,
        width: 250
    }">
        <p>Widget content</p>
    </div>

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the Installation article.

You can find the detailed information on principles of working with the widget in the dxResizable section of the Individual Widgets article.

Configuration

An object defining configuration options for the Resizable widget.

Name Description
handles

Specifies which borders of the widget element are used as a handle.

height

Specifies the height of the widget.

maxHeight

Specifies the upper height boundary for resizing.

maxWidth

Specifies the upper width boundary for resizing.

minHeight

Specifies the lower height boundary for resizing.

minWidth

Specifies the lower width boundary for resizing.

onDisposing

A handler for the disposing event.

onInitialized

A handler for the initialized event.

onOptionChanged

A handler for the optionChanged event.

onResize

A handler for the resize event.

onResizeEnd

A handler for the resizeEnd event.

onResizeStart

A handler for the resizeStart event.

rtlEnabled

Specifies whether or not the current component supports a right-to-left representation.

width

Specifies the width of the widget.

Methods

Methods of the DomComponent object.

Name Description
beginUpdate()

Prevents the component from refreshing until the endUpdate() method is called.

defaultOptions(rule)

Specifies the device-dependent default configuration options for this component.

element()

Returns the root HTML element of the widget.

endUpdate()

Enables the component to refresh after the beginUpdate() method call.

instance()

Returns an instance of this component class.

off(eventName)

Detaches all event handlers from the specified event.

off(eventName, eventHandler)

Detaches a particular event handler from the specified event.

on(eventName, eventHandler)

Subscribes to a specified event.

on(events)

Subscribes to the specified events.

option()

Returns the configuration options of this component.

option(optionName)

Gets the value of the specified configuration option of this component.

option(optionName, optionValue)

Sets a value to the specified configuration option of this component.

option(options)

Sets one or more options of this component.

Events

This section describes events fired by this widget.

Name Description
disposing

Fires when the widget is being removed.

initialized

Fires when the widget is initialized.

optionChanged

Fires after an option of the component is changed.

resize

Fires after the widget is resized.

resizeEnd

Fires when the widget has been resized.

resizeStart

Fires when an end user started to resize the widget.