Configuration

An object defining configuration options for the widget.

activeStateEnabled

Specifies whether or not the widget changes its state when interacting with a user.

Type: Boolean
Default Value: false

This option is used when the widget is displayed on a platform whose guidelines include the active state change for widgets.

contentTemplate

A template to be used for rendering widget content.

Type: template
Default Value: 'content'
NOTE
A binding context of a content template is the bound view model. So, you can bind template elements to the view model's fields directly. To access another binding context within a title template, use the Knockout/AngularJS binding variables.
See Also
Show Example:
AngularJS
Knockout
jQuery

disabled

Specifies whether the widget responds to user interaction.

Type: Boolean
Default Value: false

elementAttr

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

Type: Object
Default Value: {}

You can configure this option in an ASP.NET MVC Control as follows:

Razor C#
Razor VB
@(Html.DevExtreme().WidgetName()
    .ElementAttr("class", "class-name")
    // ===== or =====
    .ElementAttr(new {
        @id = "elementId",
        @class = "class-name"
    })
    // ===== or =====
    .ElementAttr(new Dictionary<string, object>() {
        { "id", "elementId" },
        { "class", "class-name" }
    })

)
@(Html.DevExtreme().WidgetName() _
    .ElementAttr("class", "class-name")
    ' ===== or =====
    .ElementAttr(New With {
        .id = "elementId",
        .class = "class-name"
    })
    ' ===== or =====
    .ElementAttr(New Dictionary(Of String, Object) From {
        { "id", "elementId" },
        { "class", "class-name" }
    })
)

height

Specifies the height of the widget container.

Type: Number|String| function
Return Value: Number|String

The widget height.

Default Value: undefined

This option accepts a value of one of the following types.

  • Number
    The height of the widget in pixels.

  • String
    A CSS-accepted measurement of height. For example, "55px", "80%", "auto", "inherit".

  • Function
    A function returning either of the above. For example:

    JavaScript
    height: function() {
        return window.innerHeight / 1.5;
    }

hint

Specifies text for a hint that appears when a user pauses on the widget.

Type: String
Default Value: undefined

hoverStateEnabled

Specifies whether the widget changes its state when a user pauses on it.

Type: Boolean
Default Value: false

menuPosition

Specifies the current menu position.

Type: String
Default Value: 'normal'
Accepted Values: 'normal' | 'inverted'

Normally, the menu is located at the left side of the screen. Assign 'inverted' to this option to display the menu at the opposite side.

When using the widget as an ASP.NET MVC Control, specify this option using the SlideOutMenuPosition enum. This enum accepts the following values: Normal and Inverted.

Show Example:
AngularJS
Knockout
jQuery

menuTemplate

A template to be used for rendering menu panel content.

Type: template
Default Value: null
NOTE
A binding context of a content template is the bound view model. So, you can bind template elements to the view model's fields directly (see the code above). To access another binding context within a title template, use the Knockout/AngularJS binding variables.
See Also
Show Example:
AngularJS
Knockout
jQuery

menuVisible

Specifies whether or not the menu panel is visible.

Type: Boolean
Default Value: false

Show Example:
AngularJS
Knockout
jQuery

onDisposing

A handler for the disposing event. Executed when the widget is removed from the DOM using the remove(), empty(), or html() jQuery methods only.

Type: function
Function parameters:

Information about the event.

Object structure:
component: Object
element: jQuery

The widget's container.

model: Object

The model data. Available only if you use Knockout.

Default Value: null

onInitialized

A handler for the initialized event. Executed only once, after the widget is initialized.

Type: function
Function parameters:

Information about the event.

Object structure:
component: Object
element: jQuery

The widget's container.

Default Value: null

You cannot access elements in the widget because this handler is executed before they are ready. Use the onContentReady handler instead.

onOptionChanged

A handler for the optionChanged event. Executed after an option of the widget is changed.

Type: function
Function parameters:

Information about the event.

Object structure:
component: Object
name: String

A short name of the option whose value has been changed.

fullName: String

A full name of the option whose value has been changed; contains a full hierarchy of the option.

value: any

A new value for the option.

element: jQuery

The widget's container.

model: Object

The model data. Available only if you use Knockout.

Default Value: null

rtlEnabled

Switches the widget to a right-to-left representation.

Type: Boolean
Default Value: false

When this option is set to true, the widget text flows from right to left, and the layout of elements is reversed. To switch the entire application/site to the right-to-left representation, assign true to the rtlEnabled field of the object passed to the DevExpress.config(config) method.

JavaScript
DevExpress.config({
    rtlEnabled: true
});
Show Example:
AngularJS
Knockout
jQuery

swipeEnabled

Specifies whether or not the menu is shown when a user swipes the widget content.

Type: Boolean
Default Value: true

If the option value is false, the menu can be shown only programmatically.

Show Example:
AngularJS
Knockout
jQuery

visible

Specifies whether the widget is visible.

Type: Boolean
Default Value: true

width

Specifies the width of the widget container.

Type: Number|String| function
Return Value: Number|String

The widget width.

Default Value: undefined

This option accepts a value of one of the following types.

  • Number
    The width of the widget in pixels.

  • String
    A CSS-accepted measurement of width. For example, "55px", "80%", "auto", "inherit".

  • Function
    A function returning either of the above. For example:

    JavaScript
    width: function() {
        return window.innerWidth / 1.5;
    }