Configuration

An object defining configuration options for the Resizable widget.

elementAttr

Specifies the attributes to be attached to the widget's root element.

Type: Object
Default Value: {}

When you configure this option using a server-side wrapper, pass a dictionary as shown in the following code.

Razor C#
Razor VB
@(Html.DevExtreme()
    // other widget options
    // ...
    .ElementAttr(new Dictionary<string, object>() {
        { "id", "elementId" },
        { "class", "class-name" },
        // ...
    })
)
@(Html.DevExtreme().WidgetName() _
    .ElementAttr(New Dictionary(Of String, Object) From {
        { "id", "elementId" },
        { "class", "class-name" }
    })
)

handles

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

Type: String
Default Value: 'all'
Accepted Values: 'top' | 'bottom' | 'right' | 'left' | 'all'

You can pass several values separated by a space. For example, "right bottom".

When configuring the widget using ASP.NET MVC Wrappers, specify this option with the ResizeHandle enum, which accepts the following values: Top, Bottom, Right and Left. You can combine these values by separating them with a comma, for example:

Razor C#
Razor VB
@(Html.DevExtreme().Resizable()
    .Handles(ResizeHandle.Top, ResizeHandle.Bottom)
    .Content(@<text>
        @* resizable content *@
    </text>)
)
@Code
    Html.DevExtreme().Resizable() _
        .Handles(ResizeHandle.Top, ResizeHandle.Bottom)
        .Content(Sub()
            @* resizable content *@
        End Sub).Render()
End Code
Show Example:
AngularJS
Knockout
jQuery

height

Specifies the height of the widget.

Type: Number|String| function
Return Value: Number|String
The widget height.
Default Value: undefined

The option can hold a value of the following types.

  • number
    The height of the widget in pixels

  • string
    A CSS measurement of the widget height (e.g., "55px", "80%", "auto" and "inherit")

  • function
    A function returning the widget height, e.g.,

    JavaScript
    height: function () {
        return baseHeight - 10 + "%";
    }

maxHeight

Specifies the upper height boundary for resizing.

Type: Number
Default Value: Infinity

Show Example:
AngularJS
Knockout
jQuery

maxWidth

Specifies the upper width boundary for resizing.

Type: Number
Default Value: Infinity

Show Example:
AngularJS
Knockout
jQuery

minHeight

Specifies the lower height boundary for resizing.

Type: Number
Default Value: 30

Show Example:
AngularJS
Knockout
jQuery

minWidth

Specifies the lower width boundary for resizing.

Type: Number
Default Value: 30

Show Example:
AngularJS
Knockout
jQuery

onDisposing

A handler for the disposing event.

Type: function
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element. Available only in the Knockout approach.
Default Value: null

Assign a function to perform a custom action when the widget is being removed.

NOTE
The function assigned to this option is executed only if the widget is removed using the remove(), empty(), or html() jQuery methods.

onInitialized

A handler for the initialized event.

Type: function
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
Default Value: null

Assign a function to perform a custom action when the widget is initialized.

onOptionChanged

A handler for the optionChanged event.

Type: function
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
name: String
Specifies the name of the option whose value is changed.
fullName: String
Specifies a full name of the option whose value is changed. The full name is formed by concatenating the names of the options that are presented in the hierarchy of the given option. The names are delimited by commas.
value: any
Specifies a new value for the option.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element. Available only in the Knockout approach.
Default Value: null

Assign a function to perform a custom action after an option of the component is changed.

onResize

A handler for the resize event.

Type: function
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element. Available only in the Knockout approach.
jQueryEvent: jQuery.Event
Specifies the jQuery event that caused action execution.
width: Number
The current widget width.
height: Number
The current widget height.
Default Value: null

Assign a function to perform a custom action after the widget is resized.

Show Example:
AngularJS
Knockout
jQuery

onResizeEnd

A handler for the resizeEnd event.

Type: function
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element. Available only in the Knockout approach.
jQueryEvent: jQuery.Event
Specifies the jQuery event that caused action execution.
width: Number
The current widget width.
height: Number
The current widget height.
Default Value: null

Assign a function to perform a custom action when the widget has been resized.

Show Example:
AngularJS
Knockout
jQuery

onResizeStart

A handler for the resizeStart event.

Type: function
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element. Available only in the Knockout approach.
jQueryEvent: jQuery.Event
Specifies the jQuery event that caused action execution.
width: Number
The current widget width.
height: Number
The current widget height.
Default Value: null

Assign a function to perform a custom action when an end user started to resize the widget.

Show Example:
AngularJS
Knockout
jQuery

rtlEnabled

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

Type: Boolean
Default Value: false

If you need to switch the display of this DevExtreme component to right-to-left, enable a specifically designed configuration option - rtlEnabled. When this option is set to true, the text flows from right to left, and the layout the component's elements is reversed. To switch the entire application/site to a right-to-left representation, use the static DevExpress.rtlEnabled field.

width

Specifies the width of the widget.

Type: Number|String| function
Return Value: Number|String
The widget width.
Default Value: undefined

The option can hold a value of the following types.

  • numeric
    The widget width in pixels.
  • string
    A CSS measurement of the widget width (e.g., "55px", "80%", "auto" and "inherit").
  • function
    The function returning the widget width. For example, see the following code.

    JavaScript
    width: function () { 
        return baseWidth - 10 + "%";
    }