Your search did not match any results.



The Lookup is a UI component that allows an end user to search for an item in a collection shown in a drop-down menu. This demo shows how to create a simple and a grouped Lookup.

Backend API
Copy to CodeSandBox
<div class="dx-fieldset"> <div class="dx-fieldset-header">Simple lookup</div> <div class="dx-field"> <dx-lookup [items]="employees" [value]="employees[0]"> <dxo-drop-down-options [showTitle]="false"></dxo-drop-down-options> </dx-lookup> </div> </div> <div class="dx-fieldset"> <div class="dx-fieldset-header">Grouped lookup</div> <div class="dx-field"> <dx-lookup [dataSource]="dataSource" [grouped]="true" displayExpr="Subject"> <dxo-drop-down-options [closeOnOutsideClick]="true" [showTitle]="false"> </dxo-drop-down-options> </dx-lookup> </div> </div>
import { NgModule, Component, enableProdMode } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { DxLookupModule } from 'devextreme-angular'; import DataSource from 'devextreme/data/data_source'; import ArrayStore from 'devextreme/data/array_store'; import { Service } from './app.service'; if(!/localhost/.test( { enableProdMode(); } @Component({ selector: 'demo-app', providers: [Service], templateUrl: 'app/app.component.html', styleUrls: ['app/app.component.css'] }) export class AppComponent { employees: string[]; dataSource: any; constructor(service: Service) { this.dataSource = new DataSource({ store: new ArrayStore({ data: service.getTasks(), key: "Id", }), group: "Assigned" }); this.employees = service.getEmployees(); } } @NgModule({ imports: [ BrowserModule, DxLookupModule ], declarations: [AppComponent], bootstrap: [AppComponent] }) export class AppModule { } platformBrowserDynamic().bootstrapModule(AppModule);
::ng-deep .dx-theme-generic .dx-fieldset, ::ng-deep .dx-theme-material .dx-fieldset { width: 40%; float: left; } ::ng-deep .dx-field > .dx-lookup { flex: 1; }
import { Injectable } from '@angular/core'; export class Task { Id: number; Assigned: string; Subject: string; } let employeesList: string[] = [ "John Heart", "Samantha Bright", "Arthur Miller", "Robert Reagan", "Greta Sims", "Brett Wade", "Sandra Johnson", "Ed Holmes", "Barb Banks", "Kevin Carter", "Cindy Stanwick", "Sammy Hill", "Davey Jones", "Victor Norris", "Mary Stern", "Robin Cosworth", "Kelly Rodriguez", "James Anderson", "Antony Remmen", "Olivia Peyton", "Taylor Riley", "Amelia Harper", "Wally Hobbs", "Brad Jameson", "Karen Goodson", "Marcus Orbison", "Sandy Bright", "Morgan Kennedy", "Violet Bailey", "Ken Samuelson", "Nat Maguiree", "Bart Arnaz", "Leah Simpson", "Arnie Schwartz", "Billy Zimmer", "Samantha Piper", "Maggie Boxter", "Terry Bradley", "Gabe Jones", "Lucy Ball", "Jim Packard", "Hannah Brookly", "Harv Mudd", "Clark Morgan", "Todd Hoffman", "Jackie Garmin", "Lincoln Bartlett", "Brad Farkus", "Jenny Hobbs", "Dallas Lou", "Stu Pizaro" ]; let tasks: Task[] = [{ Id: 1, Assigned: "Mr. John Heart", Subject: "Choose between PPO and HMO Health Plan" }, { Id: 2, Assigned: "Mr. John Heart", Subject: "Google AdWords Strategy" }, { Id: 3, Assigned: "Mr. John Heart", Subject: "New Brochures" }, { Id: 4, Assigned: "Mr. John Heart", Subject: "Update NDA Agreement" }, { Id: 5, Assigned: "Mr. John Heart", Subject: "Review Product Recall Report by Engineering Team" }, { Id: 6, Assigned: "Mrs. Olivia Peyton", Subject: "Update Personnel Files" }, { Id: 7, Assigned: "Mrs. Olivia Peyton", Subject: "Review Health Insurance Options Under the Affordable Care Act" }, { Id: 8, Assigned: "Mrs. Olivia Peyton", Subject: "Non-Compete Agreements" }, { Id: 9, Assigned: "Mrs. Olivia Peyton", Subject: "Give Final Approval for Refunds" }, { Id: 10, Assigned: "Mr. Robert Reagan", Subject: "Deliver R&D Plans for 2013" }, { Id: 11, Assigned: "Mr. Robert Reagan", Subject: "Decide on Mobile Devices to Use in the Field" }, { Id: 12, Assigned: "Mr. Robert Reagan", Subject: "Try New Touch-Enabled WinForms Apps" }, { Id: 13, Assigned: "Mr. Robert Reagan", Subject: "Approval on Converting to New HDMI Specification" }, { Id: 14, Assigned: "Ms. Greta Sims", Subject: "Approve Hiring of John Jeffers" }, { Id: 15, Assigned: "Ms. Greta Sims", Subject: "Update Employee Files with New NDA" }, { Id: 16, Assigned: "Ms. Greta Sims", Subject: "Provide New Health Insurance Docs" }]; @Injectable() export class Service { getEmployees(): string[] { return employeesList; } getTasks(): Task[] { return tasks; } }
// In real applications, you should not transpile code in the browser. You can see how to create your own application with Angular and DevExtreme here: // window.config = { transpiler: 'ts', typescriptOptions: { module: "system", emitDecoratorMetadata: true, experimentalDecorators: true }, meta: { 'typescript': { "exports": "ts" }, 'devextreme/localization.js': { "esModule": true }, }, paths: { 'npm:': '' }, map: { 'ts': 'npm:plugin-typescript@8.0.0/lib/plugin.js', 'typescript': 'npm:typescript@3.5.3/lib/typescript.js', '@angular': 'npm:@angular', 'tslib': 'npm:tslib@2.3.0/tslib.js', 'rxjs': 'npm:rxjs@6.4.0', 'rrule': 'npm:rrule@2.6.6/dist/es5/rrule.js', 'luxon': 'npm:luxon@1.28.0/build/global/luxon.min.js', 'es6-object-assign': 'npm:es6-object-assign@1.1.0', 'devextreme': 'npm:devextreme@21.1.5/cjs', 'devextreme/bundles/dx.all': 'npm:devextreme@21.1.5/bundles/dx.all.js', 'jszip': 'npm:jszip@3.7.0/dist/jszip.min.js', 'devextreme-quill': 'npm:devextreme-quill@1.3.1/dist/dx-quill.min.js', 'devexpress-diagram': 'npm:devexpress-diagram@2.1.25', 'devexpress-gantt': 'npm:devexpress-gantt@3.0.4', 'devextreme-angular': 'npm:devextreme-angular@21.1.5', '@devextreme/vdom': 'npm:@devextreme/vdom@1.2.2', 'inferno': 'npm:inferno@7.4.8/dist/inferno.min.js', 'inferno-compat': 'npm:inferno-compat@7.4.8/dist/inferno-compat.min.js', 'inferno-create-element': 'npm:inferno-create-element@7.4.8/dist/inferno-create-element.min.js', 'inferno-dom': 'npm:inferno-dom@1.0.7/dist/inferno-dom.min.js', 'inferno-hydrate': 'npm:inferno-hydrate@7.4.8/dist/inferno-hydrate.min.js', 'inferno-clone-vnode': 'npm:inferno-clone-vnode@7.4.8/dist/inferno-clone-vnode.min.js', 'inferno-create-class': 'npm:inferno-create-class@7.4.8/dist/inferno-create-class.min.js', 'inferno-extras': 'npm:inferno-extras@7.4.8/dist/inferno-extras.min.js' }, packages: { 'app': { main: './app.component.ts', defaultExtension: 'ts' }, 'devextreme': { defaultExtension: 'js' }, '@devextreme/vdom': { defaultExtension: 'js' }, 'devextreme/events/utils': { main: 'index' }, 'devextreme/events': { main: 'index' }, 'es6-object-assign': { main: './index.js', defaultExtension: 'js' } }, packageConfigPaths: [ "npm:@devextreme/*/package.json", "npm:@angular/*/package.json", "npm:@angular/common/*/package.json", "npm:rxjs/package.json", "npm:rxjs/operators/package.json", "npm:devextreme-angular/*/package.json", "npm:devextreme-angular/ui/*/package.json", "npm:devextreme-angular/package.json", "npm:devexpress-diagram/package.json", "npm:devexpress-gantt/package.json", ] }; System.config(window.config);
<!DOCTYPE html> <html xmlns=""> <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=1.0" /> <link rel="stylesheet" type="text/css" href="" /> <link rel="stylesheet" type="text/css" href="" /> <script src=""></script> <script src=""></script> <script src=""></script> <script src=""></script> <script src="config.js"></script> <script> System.import('app').catch(console.error.bind(console)); </script> </head> <body class="dx-viewport"> <div class="demo-container"> <demo-app>Loading...</demo-app> </div> </body> </html>