SlideOut

The SlideOut widget is a classic slide-out menu paired with a view. An end user opens the menu by swiping away the view.

Included in: dx.mobile.js, dx.all.js
Module: ui/slide_out
Export: default

DevExtreme widgets are integrated with many popular libraries and frameworks. See the Installation section (for JavaScript libraries) or the Prerequisites and Installation section (for ASP.NET MVC framework) to find details on setting up DevExtreme with a particular library or framework.

The following code shows how to create the SlideOut widget using every supported library and framework. For more details on working with widgets in these libraries and frameworks, see the Widget Basics topic for jQuery, Angular, AngularJS, Knockout or ASP.NET MVC.

jQuery
JavaScript
HTML
CSS
$(function () {
    $("#slideOut").dxSlideOut({
        dataSource: [ "Item 1", "Item 2", "Item 3", "Item 4" ],
        onItemClick: function (e) {
            e.component.hideMenu();
        }
    });
});
<div id="slideOut"></div>
#slideOut {
    height: auto;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}
Angular
HTML
TypeScript
<dx-slide-out
    [dataSource]="slideOutDataSource"
    (onItemClick)="closeSlideOut($event)">
</dx-slide-out>
import { DxSlideOutModule } from 'devextreme-angular'
// ...
export class AppComponent {
    slideOutDataSource = [ "Item 1", "Item 2", "Item 3", "Item 4" ];
    closeSlideOut = function (e) {
        e.component.hideMenu();
    }
}
@NgModule({
    imports: [
        // ...
        DxSlideOutModule
    ],
    // ...
})
AngularJS
HTML
JavaScript
CSS
<div id="slideOut" dx-slide-out="{
    dataSource: slideOutDataSource,
    onItemClick: closeSlideOut
}"></div>
angular.module('DemoApp', ['dx'])
    .controller("DemoController", function ($scope) {
        $scope.slideOutDataSource = [ "Item 1", "Item 2", "Item 3", "Item 4" ];
        $scope.closeSlideOut = function (e) {
            e.component.hideMenu();
        }
    });
#slideOut {
    height: auto;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}
Knockout
HTML
CSS
<div id="slideOut" data-bind="dxSlideOut: {
    dataSource: [ "Item 1", "Item 2", "Item 3", "Item 4" ],
    onItemClick: function (e) {
        e.component.hideMenu();
    }
}"></div>
#slideOut {
    height: auto;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}
ASP.NET MVC Controls
Razor C#
Razor VB
@(Html.DevExtreme().SlideOut()
    .ID("slideOut")
    .DataSource(new[] { "Item 1", "Item 2", "Item 3", "Item 4" })
    .OnItemClick(@<text>
        function (e) {
            e.component.hideMenu();
        }
    </text>)
)
@(Html.DevExtreme().SlideOut() _
    .ID("slideOut") _
    .DataSource({ "Item 1", "Item 2", "Item 3", "Item 4" }) _
    .OnItemClick("slideOut_itemClick")
)
<script>
    function slideOut_itemClick(e) {
        e.component.hideMenu();
    }
</script>

View Demo

See Also
Show Example:
AngularJS
Knockout
jQuery

Configuration

An object defining configuration options for the SlideOut widget.

Methods

This section describes members used to manipulate the widget.

Events

This section describes events fired by this widget.

See Also

Default Item Template

This section lists the data source fields that are used in a default template for SlideOut items.

Type:

Object

By default, a predefined item template is applied to display the items of this widget. This template is based on certain fields of the data source provided for this widget. Below is the list of these fields. If the default item template is not appropriate for your task, implement a custom item template based on these or other fields of your data source.

See Also