-
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
-
Card View
-
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
- Stepper
- Pagination
-
Tree View
- Right-to-Left Support
-
Layout
-
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
- Overview
-
Action Sheet
-
Button
- Floating Action Button
- Drop Down Button
-
Context Menu
-
List
-
Lookup
-
Maps
- Overview
-
Map
-
Vector Map
-
Dialogs and Notifications
-
Localization
JavaScript/jQuery Toast - Stack
The DevExtreme JavaScript Toast components can stack multiple notifications. Use the notify(message, stack) or notify(options, stack) method to display stacked messages.
These methods use a stack object that has the following structure: {position, direction}.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
let id = 1;
let direction = 'up-push';
let position = 'bottom center';
$(() => {
$('#create').dxButton({
text: 'Show',
width: '48%',
onClick() {
DevExpress.ui.notify({
message: `Toast ${id}`,
height: 45,
width: 150,
minWidth: 150,
type: types[Math.floor(Math.random() * 4)],
displayTime: 3500,
animation: {
show: {
type: 'fade', duration: 400, from: 0, to: 1,
},
hide: { type: 'fade', duration: 40, to: 0 },
},
},
{
position,
direction,
});
id += 1;
},
});
$('#hide').dxButton({
text: 'Hide all',
width: '48%',
onClick() {
DevExpress.ui.hideToasts();
},
});
$('#radioGroup').dxRadioGroup({
layout: 'horizontal',
value: 'predefined',
items: ['predefined', 'coordinates'],
onValueChanged: ({ value }) => {
const predefinedSelected = value === 'predefined';
positionSelect.option('visible', predefinedSelected);
topNumberBox.option('visible', !predefinedSelected);
leftNumberBox.option('visible', !predefinedSelected);
bottomNumberBox.option('visible', !predefinedSelected);
rightNumberBox.option('visible', !predefinedSelected);
position = predefinedSelected
? positionSelect.option('value')
: {
top: topNumberBox.option('value') || undefined,
left: leftNumberBox.option('value') || undefined,
bottom: bottomNumberBox.option('value') || undefined,
right: rightNumberBox.option('value') || undefined,
};
},
});
const positionSelect = $('#position').dxSelectBox({
items: positions,
inputAttr: { 'aria-label': 'Position' },
value: position,
onSelectionChanged: ({ selectedItem }) => { position = selectedItem; },
}).dxSelectBox('instance');
$('#direction').dxSelectBox({
items: directions,
inputAttr: { 'aria-label': 'Direction' },
value: direction,
onSelectionChanged: ({ selectedItem }) => { direction = selectedItem; },
});
const numberBoxValueChange = (value, pos, componentToDisable) => {
position[pos] = value || undefined;
componentToDisable.option('disabled', !!value);
};
const commonNumberBoxOptions = {
value: '',
width: '48%',
visible: false,
valueChangeEvent: 'keyup',
};
const topNumberBox = $('#positionTop').dxNumberBox({
...commonNumberBoxOptions,
placeholder: 'top',
inputAttr: { 'aria-label': 'Position Top' },
onValueChanged: ({ value }) => numberBoxValueChange(value, 'top', bottomNumberBox),
}).dxNumberBox('instance');
const bottomNumberBox = $('#positionBottom').dxNumberBox({
...commonNumberBoxOptions,
placeholder: 'bottom',
inputAttr: { 'aria-label': 'Position Bottom' },
onValueChanged: ({ value }) => numberBoxValueChange(value, 'bottom', topNumberBox),
}).dxNumberBox('instance');
const leftNumberBox = $('#positionLeft').dxNumberBox({
...commonNumberBoxOptions,
placeholder: 'left',
inputAttr: { 'aria-label': 'Position Left' },
onValueChanged: ({ value }) => numberBoxValueChange(value, 'left', rightNumberBox),
}).dxNumberBox('instance');
const rightNumberBox = $('#positionRight').dxNumberBox({
...commonNumberBoxOptions,
placeholder: 'right',
inputAttr: { 'aria-label': 'Position Right' },
onValueChanged: ({ value }) => numberBoxValueChange(value, 'right', leftNumberBox),
}).dxNumberBox('instance');
});
xxxxxxxxxx
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>↔</head>
<body class="dx-viewport">
<div class="demo-container">
<div class="options">
<div>Position</div>
<div id="radioGroup"></div>
<div id="position"></div>
<div class="section">
<div id="positionTop"></div>
<div id="positionBottom"></div>
</div>
<div class="section">
<div id="positionLeft"></div>
<div id="positionRight"></div>
</div>
<div>Direction</div>
<div id="direction"></div>
<div class="section">
<div id="create"></div>
<div id="hide"></div>
</div>
</div>
</div>
</body>
</html>
xxxxxxxxxx
.options {
padding: 20px;
background-color: rgba(191, 191, 191, 0.15);
position: absolute;
right: 0;
top: 0;
width: 260px;
display: flex;
flex-direction: column;
gap: 5px;
}
.section {
width: 100%;
display: flex;
justify-content: space-between;
}
xxxxxxxxxx
const directions = [
'down-push',
'down-stack',
'up-push',
'up-stack',
'left-push',
'left-stack',
'right-push',
'right-stack',
];
const positions = [
'top left',
'top center',
'top right',
'bottom left',
'bottom center',
'bottom right',
'left center',
'center',
'right center',
];
const types = ['error', 'info', 'success', 'warning'];
Specify Position
You can set the position
field to a string (select 'predefined' in the radio group) or an object (select 'coordinates' in the radio group). Note that if you use coordinates for the position
field, you need to specify one vertical and one horizontal coordinate only. For example, if you specify 'top', the demo disables the 'bottom' field, and vice versa.
Specify Direction
The direction
field specifies two options: which way the notification stack grows and whether new notifications appear at the end or at the beginning of the line. For this reason, the field's pull-down menu choices show pairs of values such as 'up-push' and 'up-stack'.
-
'up-push'
New toasts push the previous toasts upwards. -
'up-stack'
Toasts stack on top of each other.
Hide Toasts
To hide all toast messages, use the hideToasts method.