UI Widgets ActionSheet

A widget consisting of a set of choices related to a certain task.

Included in: dx.phonejs.js, dx.all.js

The dxActionSheet 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.

You can create a widget using one of the following approaches.

  • jQuery
    Use the dxActionSheet jQuery plug-in.

    HTML
    <div id="actionSheet"></div>
    JavaScript
    $("#actionSheet").dxActionSheet({
        dataSource: actionSheetData,
        visible: true
    });
  • Knockout
    Add a div element and apply the dxActionSheet binding to this element.

    HTML
    <div data-bind="dxActionSheet: {
        dataSource: actionSheetData,
        visible: true
    }"></div>
  • Angular
    Add a div element and apply the dx-action-sheet directive to this element.

    HTML
    <div dx-action-sheet="{
        dataSource: actionSheetData,
        visible: true
    }"></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.

See Also

Since the dxActionSheet widget is used to display multiple items, it supports common Collection Container widget functionality. You can find the detailed information on principles of working with the widget in the dxActionSheet section of the Collection Container Widgets article.

View Demo

Show Example:
AngularJS
Knockout
jQuery
<div ng-controller="demoController">
    <div class="button" dx-button="{text:'Show action sheet', onClick: showActionSheet}"></div>
    <div dx-action-sheet="{ 
        dataSource: actionSheetData,
        title: 'Choose action',
        showTitle: true,
        bindingOptions: {
            visible: 'actionSheetVisible'
        }
    }"></div>
</div>
var myApp = angular.module('myApp', ['dx']);
myApp.controller("demoController", function ($scope) {
    var processClick = function (name) {
        DevExpress.ui.notify(name + " clicked", "success", 3000);
    };
    $scope.actionSheetVisible = false;
    $scope.actionSheetData = [
        {text:"Reply", onClick: function(){ processClick("Reply")}},
        { text: "ReplyAll", onClick: function () { processClick("ReplyAll") } },
        { text: "Forward", onClick: function () { processClick("Forward") } },
        { text: "Delete", onClick: function () { processClick("Delete") } }
    ];
    $scope.showActionSheet = function () {
        $scope.actionSheetVisible = true;
    };
});
angular.element(document).ready(function () {
    angular.bootstrap(document, ['myApp']);
});
body{
    text-align:center;
}
.button{
    margin-top:25px;
}
<div class="button" data-bind="dxButton:{ text:'Show action sheet', onClick: showActionSheet }"></div>
<div data-bind="dxActionSheet: { 
    dataSource: actionSheetData,
    visible: actionSheetVisible,
    title: 'Choose action',
    showTitle: true
}"></div>
var processClick = function (name) {
    DevExpress.ui.notify(name + " clicked", "success", 3000);
};
var myViewModel = {
    actionSheetVisible: ko.observable(false),
    actionSheetData: [
        { text:"Reply", onClick: function(){ processClick("Reply")}},
        { text: "ReplyAll", onClick: function () { processClick("ReplyAll") } },
        { text: "Forward", onClick: function () { processClick("Forward") } },
        { text: "Delete", onClick: function () { processClick("Delete") } }
    ],
    showActionSheet: function () {
        this.actionSheetVisible(true);
    }
}
ko.applyBindings(myViewModel);
body{
    text-align:center;
}
.button{
    margin-top:25px;
}
<div class="button" id="showButton"></div>
<div id="myActionSheet"></div>
$("#showButton").dxButton({
    text:'Show action sheet', 
    onClick: function () {
        $("#myActionSheet").dxActionSheet("instance").show();
    }
});
$("#myActionSheet").dxActionSheet({
    dataSource: [
        { text: "Reply", onClick: function () { processClick("Reply") } },
        { text: "ReplyAll", onClick: function () { processClick("ReplyAll") } },
        { text: "Forward", onClick: function () { processClick("Forward") } },
        { text: "Delete", onClick: function () { processClick("Delete") } }
    ],
    title: 'Choose action',
    showTitle: true
});
var processClick = function(name){
    DevExpress.ui.notify( name + " clicked", "success", 3000 );
};
body{
    text-align:center;
}
.button{
    margin-top:25px;
}

Configuration

An object defining configuration options for the dxActionSheet widget.

Methods

This section describes the members used to manipulate the widget.

Events

This section describes events exposed by this widget.

Default Item Template

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

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