-
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.
Angular Form - Item Customization
Backend API
<div id="form-container">
<dx-form id="form" [formData]="employee">
<dxi-form-item itemType="group" [colCount]="2" caption="Employee Details">
<dxi-form-item dataField="FirstName" [editorOptions]="nameEditorOptions">
<dxo-form-label template="name"></dxo-form-label>
</dxi-form-item>
<dxi-form-item
dataField="Position"
editorType="dxSelectBox"
[editorOptions]="positionEditorOptions"
>
<dxi-form-validation-rule
type="required"
message="Position is required"
></dxi-form-validation-rule>
<dxo-form-label template="position"></dxo-form-label>
</dxi-form-item>
<dxi-form-item dataField="LastName" [editorOptions]="nameEditorOptions">
<dxo-form-label template="name"></dxo-form-label>
</dxi-form-item>
<dxi-form-item
dataField="HireDate"
editorType="dxDateBox"
[editorOptions]="hireDateEditorOptions"
>
<dxi-form-validation-rule
type="required"
message="Hire date is required"
></dxi-form-validation-rule>
<dxo-form-label template="date"></dxo-form-label>
</dxi-form-item>
<dxi-form-item
dataField="BirthDate"
editorType="dxDateBox"
[editorOptions]="birthDateEditorOptions"
>
<dxo-form-label template="date"></dxo-form-label>
</dxi-form-item>
<dxi-form-item dataField="Address">
<dxo-form-label template="address"></dxo-form-label>
</dxi-form-item>
<dxi-form-item
dataField="Notes"
editorType="dxTextArea"
[editorOptions]="notesEditorOptions"
[colSpan]="2"
>
<dxo-form-label template="notes"></dxo-form-label>
</dxi-form-item>
<dxi-form-item dataField="Phone" [editorOptions]="phoneEditorOptions">
<dxo-form-label template="phone"></dxo-form-label>
</dxi-form-item>
<dxi-form-item dataField="Email">
<dxo-form-label template="email"></dxo-form-label>
</dxi-form-item>
</dxi-form-item>
@for (label of labelTemplates; track label.name) {
<ng-container>
<div *dxTemplate="let data of label.name">
<div><i class="dx-icon {{ label.icon }}"></i>{{ data.text }}</div>
</div>
</ng-container>
}
<div *dxTemplate="let data of 'notes'">
<div id="template-content">
<i id="helpedInfo" class="dx-icon dx-icon-info"></i>
Additional
<br />
{{ data.text }}
</div>
<dx-tooltip
target="#helpedInfo"
showEvent="mouseenter"
hideEvent="mouseleave"
>
<div *dxTemplate="let data = data; of: 'content'">
<div id="tooltip-content">
This field must not exceed 200 characters
</div>
</div>
</dx-tooltip>
</div>
</dx-form>
</div>
import { bootstrapApplication } from '@angular/platform-browser';
import {
Component,
ViewChild,
enableProdMode,
AfterViewInit,
provideZoneChangeDetection,
} from '@angular/core';
import {
DxFormModule,
DxFormComponent,
DxTooltipModule,
} from 'devextreme-angular';
import 'devextreme/ui/select_box';
import 'devextreme/ui/text_area';
import { Employee, Service } from './app.service';
if (!/localhost/.test(document.location.host)) {
enableProdMode();
}
@Component({
selector: 'demo-app',
providers: [Service],
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
imports: [
DxFormModule,
DxTooltipModule,
],
})
export class AppComponent implements AfterViewInit {
@ViewChild(DxFormComponent, { static: false }) form: DxFormComponent;
employee: Employee;
positions: string[];
nameEditorOptions: Object;
positionEditorOptions: Object;
validationRules: Object;
hireDateEditorOptions: Object;
birthDateEditorOptions: Object;
notesEditorOptions: Object;
phoneEditorOptions: Object;
labelTemplates: { name: string; icon: string }[];
constructor(service: Service) {
this.employee = service.getEmployee();
this.nameEditorOptions = { disabled: true };
this.positionEditorOptions = { items: service.getPositions(), searchEnabled: true, value: '' };
this.validationRules = {
position: [
{ type: 'required', message: 'Position is required.' },
],
hireDate: [
{ type: 'required', message: 'Hire Date is required.' },
],
};
this.hireDateEditorOptions = { width: '100%', value: null };
this.birthDateEditorOptions = { width: '100%', disabled: true };
this.notesEditorOptions = { height: 90, maxLength: 200 };
this.phoneEditorOptions = { mask: '(X00) 000-0000', maskRules: { X: /[02-9]/ } };
this.labelTemplates = [
{ name: 'name', icon: 'dx-icon-user' },
{ name: 'position', icon: 'dx-icon-info' },
{ name: 'date', icon: 'dx-icon-event' },
{ name: 'address', icon: 'dx-icon-home' },
{ name: 'phone', icon: 'dx-icon-tel' },
{ name: 'email', icon: 'dx-icon-email' },
];
}
ngAfterViewInit() {
this.form.instance.validate();
}
}
bootstrapApplication(AppComponent, {
providers: [
provideZoneChangeDetection({ eventCoalescing: true, runCoalescing: true }),
],
});
::ng-deep #helpedInfo {
color: #42a5f5;
}
::ng-deep #tooltip-content {
font-size: 14px;
font-weight: bold;
}
::ng-deep #template-content {
display: inline-flex;
}
import { Injectable } from '@angular/core';
export class Employee {
ID: number;
FirstName: string;
LastName: string;
Position: string;
BirthDate: string;
HireDate: string;
Notes: string;
Address: string;
Phone: string;
Email: string;
}
const employee: Employee = {
ID: 1,
FirstName: 'John',
LastName: 'Heart',
Position: 'CEO',
BirthDate: '1964/03/16',
HireDate: '1995/01/15',
Notes: 'John has been in the Audio/Video industry since 1990. He has led DevAv as its CEO since 2003.\r\n\r\nWhen not working hard as the CEO, John loves to golf and bowl. He once bowled a perfect game of 300.',
Address: '351 S Hill St., Los Angeles, CA',
Phone: '360-684-1334',
Email: 'jheart@dx-email.com',
};
const positions: string[] = [
'HR Manager',
'IT Manager',
'CEO',
'Controller',
'Sales Manager',
'Support Manager',
'Shipping Manager',
];
@Injectable()
export class Service {
getEmployee(): Employee {
return employee;
}
getPositions(): string[] {
return positions;
}
}
<!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" />
</head>
<body class="dx-viewport">
<div class="demo-container">
<demo-app>Loading...</demo-app>
</div>
<script src="https://cdn.jsdelivr.net/npm/zone.js@0.16.2/bundles/zone.umd.js"></script>
<script src="./bundle.js" type="module"></script>
</body>
</html>
To change the default settings, declare an item configuration object. Use the dataField property to bind an item to a field in the formData object. Use the editorType property to specify an item's data editor or configure the editor in the editorOptions object. You can also specify any other properties described in the SimpleItem section.
To customize item labels, use the label.template property. The demo uses this property to add icons to the labels. Refer to the Additional Notes item's implementation for instructions on how to add an icon with a tooltip to the label.
This demo shows how to specify editorOptions, editorType, validationRules, and colSpan properties for simple items in a Form component.