import { Component, EventHandler, addClass, append, Property, Event, KeyboardEvents, EmitType, L10n, compile, KeyboardEventArgs } from '@syncfusion/ej2-base';import { setStyleAttribute, extend, removeClass, prepend, isNullOrUndefined, detach, getValue, AnimationModel } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, INotifyPropertyChanged, rippleEffect, RippleOptions, ChildProperty, Complex } from '@syncfusion/ej2-base';import { DataManager, Query, DataOptions, DataUtil } from '@syncfusion/ej2-data';import { ListBase, SortOrder } from '@syncfusion/ej2-lists';import { Popup } from '@syncfusion/ej2-popups';import { select, selectAll } from '@syncfusion/ej2-base';import { VirtualInfo, VirtualScroll } from '../common/virtual-scroll';import { GeneratedData } from '../drop-down-list';import { Skeleton } from '@syncfusion/ej2-notifications'; import {FilterType,SelectEventArgs} from "./drop-down-base"; import {ComponentModel} from '@syncfusion/ej2-base'; /** * Interface for a class FieldSettings */ export interface FieldSettingsModel { /** * Maps the text column from data table for each list item * * @default null */ text?: string; /** * Maps the value column from data table for each list item * * @default null */ value?: string; /** * Maps the icon class column from data table for each list item. * * @default null */ iconCss?: string; /** * Group the list items with it's related items by mapping groupBy field. * * @default null */ groupBy?: string; /** * Allows additional attributes such as title, disabled, etc., to configure the elements * in various ways to meet the criteria. * * @default null */ htmlAttributes?: string; /** * Defines whether the particular field value is disabled or not. * * @default null */ disabled?: string; } /** * Interface for a class DropDownBase */ export interface DropDownBaseModel extends ComponentModel{ /** * The `fields` property maps the columns of the data table and binds the data to the component. * * text - Maps the text column from data table for each list item. * * value - Maps the value column from data table for each list item. * * iconCss - Maps the icon class column from data table for each list item. * * groupBy - Group the list items with it's related items by mapping groupBy field. * ```html * * ``` * ```typescript * let customers: DropDownList = new DropDownList({ * dataSource:new DataManager({ url:'http://js.syncfusion.com/demos/ejServices/Wcf/Northwind.svc/' }), * query: new Query().from('Customers').select(['ContactName', 'CustomerID']).take(5), * fields: { text: 'ContactName', value: 'CustomerID' }, * placeholder: 'Select a customer' * }); * customers.appendTo("#list"); * ``` * * @default {text: null, value: null, iconCss: null, groupBy: null, disabled: null} */ fields?: FieldSettingsModel; /** * Accepts the template design and assigns it to each list item present in the popup. * We have built-in `template engine` * * which provides options to compile template string into a executable function. * For EX: We have expression evolution as like ES6 expression string literals. * * @default null * @aspType string */ itemTemplate?: string | Function; /** * Accepts the template design and assigns it to the group headers present in the popup list. * * @default null * @aspType string */ groupTemplate?: string | Function; /** * Accepts the template design and assigns it to popup list of component * when no data is available on the component. * * @default 'No records found' * @aspType string */ noRecordsTemplate?: string | Function; /** * Accepts the template and assigns it to the popup list content of the component * when the data fetch request from the remote server fails. * * @default 'Request failed' * @aspType string */ actionFailureTemplate?: string | Function; /** * Specifies the `sortOrder` to sort the data source. The available type of sort orders are * * `None` - The data source is not sorting. * * `Ascending` - The data source is sorting with ascending order. * * `Descending` - The data source is sorting with descending order. * * @default null * @asptype object * @aspjsonconverterignore */ sortOrder?: SortOrder; /** * Accepts the list items either through local or remote service and binds it to the component. * It can be an array of JSON Objects or an instance of * `DataManager`. * * @default [] */ dataSource?: { [key: string]: Object }[] | DataManager | string[] | number[] | boolean[]; /** * Accepts the external `Query` * which will execute along with the data processing. * * @default null */ query?: Query; /** * Determines on which filter type, the component needs to be considered on search action. * The `FilterType` and its supported data types are * *
|
* FilterType |
* Description |
* Supported Types |
|
* StartsWith |
* Checks whether a value begins with the specified value. |
* String |
|
* EndsWith |
* Checks whether a value ends with specified value. |
* String |
|
* Contains |
* Checks whether a value contains with specified value. |
* String |