-
AI-powered Extensions
-
Data Grid
-
Tree List
-
Chat
-
HTML Editor
-
Form
-
-
Data Grids / Data Management
-
Data Grid
- Overview
-
Data Binding
-
Filtering
- Sorting
-
Editing
-
Grouping
-
Selection
- Focused Row
- Paging
-
Scrolling
-
Columns
- AI Assistant
-
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
-
-
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
- 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
-
Action Sheet
-
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
- Box
- Responsive Box
-
-
Interactive Wrappers
-
Sortable
- Resizable
-
-
Progress Indicators
-
Maps
- Overview
-
Map
-
Vector Map
-
Data Binding
- Multiple Layers
-
Markers
- Legend
-
Zooming and Panning
-
Customization
-
-
Localization
Related Demos:
Your search did not match any results.
Vue Data Editors - Custom Text Editor Buttons
Text editors have built-in action buttons that allow users to open a drop-down menu, increase, decrease, or nullify the value, and perform other actions. To add custom action buttons for different scenarios, use the buttons[] array.
Backend API
<template>
<div>
<div class="dx-fieldset">
<div class="dx-field">
<div class="dx-field-label">Password TextBox</div>
<div class="dx-field-value">
<DxTextBox
v-model:mode="passwordMode"
value="password"
:input-attr="{ 'aria-label': 'Password' }"
styling-mode="filled"
placeholder="password"
>
<DxTextBoxButton
:options="passwordButton"
name="password"
location="after"
/>
</DxTextBox>
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Multi-currency NumberBox</div>
<div class="dx-field-value">
<DxNumberBox
v-model:value="currencyValue"
:format="currencyFormat"
:show-clear-button="true"
:show-spin-buttons="true"
:input-attr="{ 'aria-label': 'Currency Value' }"
>
<DxNumberBoxButton
:options="currencyButton"
name="currency"
location="after"
/>
<DxNumberBoxButton name="clear"/>
<DxNumberBoxButton name="spins"/>
</DxNumberBox>
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Advanced DateBox</div>
<div class="dx-field-value">
<DxDateBox
v-model:value="dateValue"
:input-attr="{ 'aria-label': 'Date' }"
styling-mode="outlined"
>
<DxDateBoxButton
:options="todayButton"
name="today"
location="before"
/>
<DxDateBoxButton
:options="prevDateButton"
name="prevDate"
location="before"
/>
<DxDateBoxButton
:options="nextDateButton"
name="nextDate"
location="after"
/>
<DxDateBoxButton name="dropDown"/>
</DxDateBox>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { DxTextBox, DxButton as DxTextBoxButton, type DxTextBoxTypes } from 'devextreme-vue/text-box';
import { DxNumberBox, DxButton as DxNumberBoxButton } from 'devextreme-vue/number-box';
import { DxDateBox, DxButton as DxDateBoxButton } from 'devextreme-vue/date-box';
import { type DxButtonTypes } from 'devextreme-vue/button';
const millisecondsInDay = 24 * 60 * 60 * 1000;
const passwordMode = ref<DxTextBoxTypes.TextBoxType>('password');
const passwordButton = {
icon: 'eyeopen',
stylingMode: 'text',
onClick: () => {
passwordMode.value = passwordMode.value === 'text' ? 'password' : 'text';
},
};
const currencyFormat = ref('$ #.##');
const currencyValue = ref(14500.55);
const currencyButton = {
text: '€',
stylingMode: 'text',
width: 32,
elementAttr: {
class: 'currency',
},
onClick: (e: DxButtonTypes.ClickEvent) => {
if (e.component.option('text') === '$') {
e.component.option('text', '€');
currencyFormat.value = '$ #.##';
currencyValue.value /= 0.836;
} else {
e.component.option('text', '$');
currencyFormat.value = '€ #.##';
currencyValue.value *= 0.836;
}
},
};
const dateValue = ref(new Date().getTime());
const todayButton = {
text: 'Today',
stylingMode: 'text',
onClick: () => {
dateValue.value = new Date().getTime();
},
};
const prevDateButton = {
icon: 'spinprev',
stylingMode: 'text',
onClick: () => {
dateValue.value -= millisecondsInDay;
},
};
const nextDateButton = {
icon: 'spinnext',
stylingMode: 'text',
onClick: () => {
dateValue.value += millisecondsInDay;
},
};
</script>
<style>
.dx-fieldset {
min-height: 560px;
width: 560px;
margin: 0 auto;
}
.currency {
min-width: 32px;
}
.dx-button.currency .dx-button-content {
font-size: 120%;
padding-left: 5px;
padding-right: 5px;
}
</style>
import { createApp } from 'vue';
import App from './App.vue';
createApp(App).mount('#app');
<!DOCTYPE html>
<html lang="en">
<head>
<title>DevExtreme Demo</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" />
<link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/26.1.5/css/dx.light.css" />
<link rel="stylesheet" type="text/css" href="./bundle.css" />
</head>
<body class="dx-viewport">
<div class="demo-container">
<div id="app"> </div>
</div>
<script src="bundles/vendor/vue.vendor.js"></script>
<script src="./bundle.js"></script>
</body>
</html>
Each object in the buttons[] array should have the name field—the button's identifier. In addition, specify the button's location relative to the input text field and options of the Button component used as the action button.
The buttons[] array also accepts string values—the names of built-in buttons. Declare them in the order the buttons should have in the component. String and object declarations can be used in the same array.