-
Data Grid
- Overview
-
Data Binding
-
Paging and Scrolling
-
Editing
-
Grouping
-
Filtering and Sorting
- Focused Row
-
Row Drag & Drop
-
Selection
-
Columns
- State Persistence
-
Appearance
-
Templates
-
Data Summaries
-
Master-Detail
-
Export to PDF
-
Export to Excel
-
Adaptability
- Keyboard Navigation
-
Pivot Grid
- Overview
-
Data Binding
-
Field Chooser
-
Features
-
Export to Excel
-
Tree List
- Overview
-
Data Binding
- Sorting
- Paging
-
Editing
- Node Drag & Drop
- Focused Row
-
Selection
-
Filtering
-
Column Customization
- State Persistence
- Adaptability
- Keyboard Navigation
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Features
- Virtual Scrolling
-
Grouping
-
Customization
- Adaptability
-
Html Editor
-
Chat
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
Charts
- Overview
-
Data Binding
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Line Charts
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
-
Sparkline Charts
-
Tree Map
-
Funnel and Pyramid Charts
- Sankey Chart
-
Combinations
-
More Features
-
Export
-
Selection
-
Tooltips
-
Zooming
-
-
Gantt
- Overview
-
Data
-
UI Customization
- Strip Lines
- Export to PDF
- Sorting
-
Filtering
-
Gauges
- Overview
-
Data Binding
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Navigation
- Overview
- Accordion
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
- Pagination
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
- Resizable
-
-
Editors
- Overview
- Autocomplete
-
Calendar
- Check Box
- Color Box
- Date Box
-
Date Range Box
-
Drop Down Box
-
Number Box
-
Select Box
- Switch
-
Tag Box
- Text Area
- Text Box
- Validation
- Custom Text Editor Buttons
- Right-to-Left Support
- Editor Appearance Variants
-
Forms and Multi-Purpose
- Overview
- Button Group
- Field Set
-
Filter Builder
-
Form
- Radio Group
-
Range Selector
- Numeric Scale (Lightweight)
- Numeric Scale
- Date-Time Scale (Lightweight)
- Date-Time Scale
- Logarithmic Scale
- Discrete scale
- Custom Formatting
- Use Range Selection for Calculation
- Use Range Selection for Filtering
- Image on Background
- Chart on Background
- Customized Chart on Background
- Chart on Background with Series Template
- Range Slider
- Slider
-
Sortable
-
File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Actions and Lists
-
Maps
- Overview
-
Map
-
Vector Map
-
Dialogs and Notifications
-
Localization
Action Sheet - Basics
The JavaScript ActionSheet component is a pop-up sheet that contains a set of buttons. These buttons allow users to perform custom actions related to a single task (call, send a message, delete, or edit a selected contact). This demo shows how to create a simple JavaScript ActionSheet and handle button clicks.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
$(() => {
const actionSheet = $('#action-sheet').dxActionSheet({
dataSource: actionSheetItems,
title: 'Choose action',
onCancelClick() {
showNotify('Cancel');
},
onItemClick(value) {
showNotify(value.itemData.text);
},
}).dxActionSheet('instance');
function showNotify(value) {
DevExpress.ui.notify(`The "${value}" button is clicked.`);
}
$('#button').dxButton({
text: 'Click to show Action Sheet',
onClick() {
actionSheet.option('visible', true);
},
});
$('#show-title').dxSwitch({
value: actionSheet.option('showTitle'),
onValueChanged(e) {
actionSheet.option('showTitle', e.value);
},
});
$('#show-cancelbutton').dxSwitch({
value: actionSheet.option('showCancelButton'),
onValueChanged(e) {
actionSheet.option('showCancelButton', e.value);
},
});
});
xxxxxxxxxx
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>↔</head>
<body class="dx-viewport">
<div class="demo-container">
<div id="action-sheet"></div>
<div id="button" class="button"></div>
<div class="options">
<div class="caption">Options</div>
<div class="option">
<span>Show title</span>
<div id="show-title"></div>
</div>
<div class="option">
<span>Show cancel button</span>
<div id="show-cancelbutton"></div>
</div>
</div>
</div>
</body>
</html>
xxxxxxxxxx
.button {
width: 280px;
display: flex;
margin: 20px auto;
}
.options {
padding: 20px;
background-color: rgba(191, 191, 191, 0.15);
left: 0;
position: absolute;
bottom: 0;
right: 0;
}
.caption {
font-size: 18px;
font-weight: 500;
}
.option {
margin-top: 10px;
line-height: 28px;
text-align: right;
display: inline-block;
width: 100%;
}
.option > span {
float: left;
}
xxxxxxxxxx
const actionSheetItems = [
{ text: 'Call' },
{ text: 'Send message' },
{ text: 'Edit' },
{ text: 'Delete' },
];
Specify Buttons and Title
JavaScript ActionSheet can contain multiple buttons. To specify and configure them, use one of these properties:
-
items[]
Accepts a local data array. -
dataSource
Accepts a local data array or a DataSource object. This object works with local and remote arrays and allows you to shape data.
For each button, you can specify a text, type, icon, template, and other properties. In this demo, the JavaScript ActionSheet buttons are configured in a local array assigned to the dataSource property. Each button includes the text property only.
If you want to display a title, assign the text to the title property.
Handle Button Clicks
You can assign a function to the onItemClick property to handle button clicks. Use the e.itemData
field within the function to determine which button was clicked. You can also use the onCancelClick property handle a click on the built-in Cancel button. In this demo, the JavaScript ActionSheet component displays a notification with the button's name when you click a button.