-
Data Grids / Data Management
-
Data Grid
- Overview
-
Data Binding
-
Filtering
- Sorting
-
Editing
-
Grouping
-
Selection
- Focused Row
- Paging
-
Scrolling
-
Columns
-
Master-Detail
-
Data Summaries
-
Drag & Drop
-
Export to PDF
-
Export to Excel
- Appearance
-
Customization
- State Persistence
-
Adaptability
-
Keyboard Navigation
- Right-To-Left Support
-
Tree List
- Overview
-
Data Binding
-
Filtering
- Sorting
-
Editing
-
Selection
- Focused Row
- Paging
-
Columns
- Drag & Drop
- State Persistence
- Adaptability
-
Keyboard Navigation
-
Card View
-
Pivot Grid
- Overview
-
Data Binding
-
Field Management
-
Data Summaries
- Drill Down
- Filtering
-
Scrolling
-
Export to Excel
- Chart Integration
- Customization
- State Persistence
-
Filter Builder
-
-
Data Visualization
-
Charts
- Overview
-
Data Binding
-
Common Concepts
-
Axis
-
Aggregation
-
Tooltips
-
Selection
-
Customization
-
Zooming
-
Export
-
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Funnel and Pyramid Charts
-
Line Charts
- Pareto Chart
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
- Sankey Chart
-
Sparkline Charts
-
Tree Map
-
Gauges
- Overview
-
Runtime update
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
-
Scheduling / Planning
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Appointments
-
Timetable
- Editing
-
Grouping
- Virtual Scrolling
- Drag & Drop
-
Customization
- Adaptability
-
Gantt
- Overview
- Data Binding
-
Filtering
- Sorting
- Strip Lines
- Export to PDF
- Validation
-
Customization
-
-
Reporting
-
AI-powered Extensions
-
Interaction
-
Report Types
-
Data binding
-
Real-life Reports
-
Layout Features
-
Report Controls
-
Web-specific Features
-
-
Rich Text Editor
- Overview
- Load/Save
- Document Protection
-
Templates
- Autocorrect
-
Customization
- Simple View
-
Spreadsheet
- Overview
-
Open a Document
- Export And Printing
-
Features
-
UI Customization
-
Messaging
-
WYSIWYG Editor
-
Forms
-
Data Editors
- Overview
-
Common Concepts
-
Calendar
- Check Box
- Color Box
- Date Box
-
Date Range Box
-
Number Box
- Radio Group
-
Range Selector
- Range Slider
- Slider
- Speech To Text
- Switch
- Text Area
- Text Box
-
Drop-Downs
- Autocomplete
-
Drop Down Box
-
Select Box
-
Tag Box
-
Lookup
-
Buttons
-
File Upload / File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Popup and Notifications
-
Navigation
- Overview
- Accordion
-
Context Menu
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
-
Stepper
- Pagination
-
List
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
-
-
Interactive Wrappers
-
Sortable
- Resizable
-
-
Progress Indicators
-
Maps
- Overview
-
Map
-
Vector Map
-
Data Binding
- Multiple Layers
-
Markers
- Legend
-
Zooming and Panning
-
Customization
-
-
Localization
Chat - Overview
JavaScript Chat is an interactive UI component designed to send/receive messages in real time.
To get started with the DevExtreme JavaScript Chat component, refer to the following step-by-step tutorial: Getting Started with JavaScript Chat.
The demo implements basic JavaScript Chat functionality: specifies initial messages, updates the conversation with new incoming/outgoing messages, manages users, and links two chats in real-time.
$(() => { function onMessageEntered({ message }) { userChat.renderMessage(message); supportChat.renderMessage(message); } function userChatTypingStart() { supportChat.option('typingUsers', [currentUser]); } function userChatTypingEnd() { supportChat.option('typingUsers', []); } function supportChatTypingStart() { userChat.option('typingUsers', [supportAgent]); } function supportChatTypingEnd() { userChat.option('typingUsers', []); } const userChat = $('#user-chat').dxChat({ items: initialMessages, user: currentUser, onMessageEntered, onTypingStart: userChatTypingStart, onTypingEnd: userChatTypingEnd, }).dxChat('instance'); const supportChat = $('#support-chat').dxChat({ items: initialMessages, user: supportAgent, onMessageEntered, onTypingStart: supportChatTypingStart, onTypingEnd: supportChatTypingEnd, }).dxChat('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 id="user-chat"></div> <div id="support-chat"></div> </div> </body></html>xxxxxxxxxx.demo-container { display: flex; gap: 20px;}.dx-chat { height: 710px;}.dx-avatar { border: 1px solid var(--dx-color-border);}xxxxxxxxxxconst getTimestamp = function (date, offsetMinutes = 0) { return date.getTime() + offsetMinutes * 60000;};const date = new Date();date.setHours(0, 0, 0, 0);const currentUser = { id: 'c94c0e76-fb49-4b9b-8f07-9f93ed93b4f3', name: 'John Doe',};const supportAgent = { id: 'd16d1a4c-5c67-4e20-b70e-2991c22747c3', name: 'Support Agent', avatarUrl: 'images/petersmith.png',};const initialMessages = [ { timestamp: getTimestamp(date, -9), author: supportAgent, text: 'Hello, John!\nHow can I assist you today?', }, { timestamp: getTimestamp(date, -7), author: currentUser, text: "Hi, I'm having trouble accessing my account.", }, { timestamp: getTimestamp(date, -7), author: currentUser, text: 'It says my password is incorrect.', }, { timestamp: getTimestamp(date, -7), author: supportAgent, text: 'I can help you with that. Can you please confirm your UserID for security purposes?', }, { timestamp: getTimestamp(date, 1), author: currentUser, text: 'john.doe1357', }, { timestamp: getTimestamp(date, 1), author: supportAgent, text: '✅ Instructions to restore access have been sent to the email address associated with your account.', },];Messages
To specify an initial message, you can populate the items array (shown in this demo) or use a dataSource.
Use the following API to render new messages:
- If using items, call the renderMessage() method.
- If using a dataSource, implement load and insert operations.
Users
To specify the chat owner, set the user property. Owner messages align to the right (or left in RTL mode) and do not display a name or avatar.
Each message includes information about the sender (author): name, avatar, and alternative avatar text. If no avatar is set, the user's initials are displayed instead.
Events
If a user enters a message, the JavaScript Chat component raises the messageEntered event. Use the event handler to process the message. For example, you can display the message in the message feed and send the message to the server for storage.
When users start or complete text entry, our JavaScript Chat component raises typingStart and typingEnd events. Use these events to manage the typingUsers array. The DevExtreme JavaScript Chat uses this array to display a list of active users.