UI Widgets Resizable

A widget that displays required content in a resizable element.

The dxResizable 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 a 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>
  • Angular
    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 and Globalize libraries to your application. If you use the Knockout or Angular approach, the Knockout or Angular 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.

Show Example:
AngularJS
Knockout
jQuery
<div ng-controller="demoController" style="height: 100%;">
    <div dx-resizable="{
        handles: 'right bottom',
        minHeight: 100,
        minWidth: 200,
        maxHeight: 400,
        maxWidth: 300,
        width: 200,
        height: 100
    }">
        <p><b>Resize this element</b></p>
    </div>
</div>
var myApp = angular.module('myApp', ['dx']);
myApp.controller("demoController", function () { });
angular.element(document).ready(function () {
    angular.bootstrap(document, ['myApp']);
});
body{
    text-align: center;
}
.dx-resizable{
    display:inline-block;
    margin-top: 20px;
    border: solid 2px #053;
    background-color: #ccc;
}
.dx-resizable p{
    color: #333;
    margin-top: 20px;
    font-size: larger;
}
<div data-bind="dxResizable: {
    handles: 'right bottom',
    minHeight: 100,
    minWidth: 200,
    maxHeight: 400,
    maxWidth: 300,
    width: 200,
    height: 100
}">
    <p><b>Resize this element</b></p>
</div>
var myViewModel = {}
ko.applyBindings(myViewModel);
body{
    text-align: center;
}
.dx-resizable{
    display:inline-block;
    margin-top: 20px;
    border: solid 2px #053;
    background-color: #ccc;
}
.dx-resizable p{
    color: #333;
    margin-top: 20px;
    font-size: larger;
}
<div id="myResizable">
    <p><b>Resize this element</b></p>
</div>
$("#myResizable").dxResizable({
    handles: 'right bottom',
    minHeight: 100,
    minWidth: 200,
    maxHeight: 400,
    maxWidth: 300,
    width: 200,
    height: 100
});
body{
    text-align: center;
}
.dx-resizable{
    display:inline-block;
    margin-top: 20px;
    border: solid 2px #053;
    background-color: #ccc;
}
.dx-resizable p{
    color: #333;
    margin-top: 20px;
    font-size: larger;
}

Configuration

An object defining configuration options for the dxResizable widget.

Methods

Methods of the DomComponent object.

Events

This section describes events fired by this widget.