ActionSheet

The ActionSheet widget is a sheet containing a set of buttons located one under the other. These buttons usually represent several choices relating to a single task.

Included in: dx.mobile.js, dx.all.js
Module: ui/action_sheet
Export: default
ActionSheet interactive configuration
Copy Code
Copy to Codepen
$("#actionsheet").dxActionSheet({
});

                    

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 ActionSheet 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
$(function () {
    $("#actionSheet").dxActionSheet({
        dataSource: [
            { text: "Command 1" },
            { text: "Command 2" },
            { text: "Command 3" },
            { text: "Command 4" }
        ],
        visible: true,
        onItemClick: function (e) {
            alert("The " + e.itemData.text + " button was clicked");
        }
    });
});
<div id="actionSheet"></div>
Angular
HTML
TypeScript
<dx-action-sheet
    [dataSource]="actionSheetData"
    [visible]="true"
    (onItemClick)="showAlert($event)">
</dx-action-sheet>
import { DxActionSheetModule } from 'devextreme-angular';
// ...
export class AppComponent {
    actionSheetData = [
        { text: "Command 1" },
        { text: "Command 2" },
        { text: "Command 3" },
        { text: "Command 4" }
    ];
    showAlert (e) {
        alert("The " + e.itemData.text + " button was clicked");
    }
}
@NgModule({
    imports: [
        // ...
        DxActionSheetModule
    ],
    // ...
})
AngularJS
HTML
JavaScript
<div ng-controller="DemoController">
    <div dx-action-sheet="{
        dataSource: actionSheetData,
        visible: true,
        onItemClick: showAlert
    }"></div>
</div>
angular.module('DemoApp', ['dx'])
    .controller('DemoController', function ($scope) {
        $scope.actionSheetData = [
            { text: "Command 1" },
            { text: "Command 2" },
            { text: "Command 3" },
            { text: "Command 4" }
        ];
        $scope.showAlert = function (e) {
            alert("The " + e.itemData.text + " button was clicked");
        };
    });
Knockout
HTML
JavaScript
<div data-bind="dxActionSheet: {
    dataSource: actionSheetData,
    visible: true,
    onItemClick: function (e) {
        alert('The ' + e.itemData.text + ' button was clicked');
    }
}"></div>
var viewModel = {
    actionSheetData: [
        { text: "Command 1" },
        { text: "Command 2" },
        { text: "Command 3" },
        { text: "Command 4" }
    ]
};

ko.applyBindings(viewModel);
ASP.NET MVC Controls
Razor C#
Razor VB
@(Html.DevExtreme().ActionSheet()
    .ID("actionSheet")
    .DataSource(new[] {
        new { text = "Command 1" },
        new { text = "Command 2" },
        new { text = "Command 3" },
        new { text = "Command 4" }
    })
    .Visible(true)
    .OnItemClick(@<text>
        function (e) {
            alert("The " + e.itemData.text + " button was clicked");
        }
    </text>)
)
@(Html.DevExtreme().ActionSheet() _
    .ID("actionSheet") _
    .DataSource({
        New With { .text = "Command 1" },
        New With { .text = "Command 2" },
        New With { .text = "Command 3" },
        New With { .text = "Command 4" }
    }) _
    .Visible(True) _
    .OnItemClick("button_click")
)
<script>
    function button_click (e) {
        alert("The " + e.itemData.text + " button was clicked");
    }
</script>

View Demo

See Also
Show Example:
AngularJS
Knockout
jQuery

Configuration

An object defining configuration options for the ActionSheet widget.

Methods

This section describes the 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 action sheet 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 a 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