/** * DevExtreme (ui/list.d.ts) * Version: 21.1.7 * Build date: Thu Aug 07 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import { UserDefinedElement, DxElement, } from '../core/element'; import { template, } from '../core/templates/template'; import { DxPromise, } from '../core/utils/deferred'; import DataSource, { Options as DataSourceOptions, } from '../data/data_source'; import Store from '../data/abstract_store'; import { EventInfo, NativeEventInfo, InitializedEventInfo, ChangedOptionInfo, ItemInfo, } from '../events/index'; import CollectionWidget, { CollectionWidgetItem, CollectionWidgetOptions, SelectionChangedInfo, } from './collection/ui.collection_widget.base'; import { dxSortableOptions, } from './sortable'; import { SearchBoxMixinOptions, } from './widget/ui.search_box_mixin'; interface ListItemInfo { readonly itemData?: any; readonly itemElement: DxElement; readonly itemIndex: number | { group: number; item: number }; } export interface ScrollInfo { readonly scrollOffset?: any; readonly reachedLeft: boolean; readonly reachedRight: boolean; readonly reachedTop: boolean; readonly reachedBottom: boolean; } /** @public */ export type ContentReadyEvent = EventInfo; /** @public */ export type DisposingEvent = EventInfo; /** @public */ export type GroupRenderedEvent = EventInfo & { readonly groupData?: any; readonly groupElement?: DxElement; readonly groupIndex?: number; }; /** @public */ export type InitializedEvent = InitializedEventInfo; /** @public */ export type ItemClickEvent = NativeEventInfo & ListItemInfo; /** @public */ export type ItemContextMenuEvent = NativeEventInfo & ListItemInfo; /** @public */ export type ItemDeletedEvent = EventInfo & ListItemInfo; /** @public */ export type ItemDeletingEvent = EventInfo & ListItemInfo & { cancel?: boolean | PromiseLike; }; /** @public */ export type ItemHoldEvent = NativeEventInfo & ListItemInfo; /** @public */ export type ItemRenderedEvent = EventInfo & ItemInfo; /** @public */ export type ItemReorderedEvent = EventInfo & ListItemInfo & { readonly fromIndex: number; readonly toIndex: number; }; /** @public */ export type ItemSwipeEvent = NativeEventInfo & ListItemInfo & { readonly direction: string; }; /** @public */ export type OptionChangedEvent = EventInfo & ChangedOptionInfo; /** @public */ export type PageLoadingEvent = EventInfo; /** @public */ export type PullRefreshEvent = EventInfo; /** @public */ export type ScrollEvent = NativeEventInfo & ScrollInfo; /** @public */ export type SelectAllValueChangedEvent = EventInfo & { readonly value: boolean; }; /** @public */ export type SelectionChangedEvent = EventInfo & SelectionChangedInfo; /** * @deprecated use Properties instead * @namespace DevExpress.ui */ export interface dxListOptions extends CollectionWidgetOptions, SearchBoxMixinOptions { /** * @docid * @default true * @public */ activeStateEnabled?: boolean; /** * @docid * @default false * @public */ allowItemDeleting?: boolean; /** * @docid * @default true * @default false &for(desktop) * @public */ bounceEnabled?: boolean; /** * @docid * @default false * @public */ collapsibleGroups?: boolean; /** * @docid * @type string | Array | Store | DataSource | DataSourceOptions * @default null * @public */ dataSource?: string | Array | Store | DataSource | DataSourceOptions; /** * @docid * @default undefined * @type_function_param1 item:object * @public */ displayExpr?: string | ((item: any) => string); /** * @docid * @default true &for(desktop) * @public */ focusStateEnabled?: boolean; /** * @docid * @default "group" * @type_function_param1 groupData:object * @type_function_return string|Element|jQuery * @public */ groupTemplate?: template | ((groupData: any, groupIndex: number, groupElement: DxElement) => string | UserDefinedElement); /** * @docid * @default false * @public */ grouped?: boolean; /** * @docid * @default true * @public */ hoverStateEnabled?: boolean; /** * @docid * @default true * @public */ indicateLoading?: boolean; /** * @docid * @type Enums.ListItemDeleteMode * @default 'static' * @default 'slideItem' &for(iOS) * @default 'swipe' &for(Android) * @public */ itemDeleteMode?: 'context' | 'slideButton' | 'slideItem' | 'static' | 'swipe' | 'toggle'; /** * @docid * @public */ itemDragging?: dxSortableOptions; /** * @docid * @type Array * @fires dxListOptions.onOptionChanged * @public */ items?: Array; /** * @docid * @default [] * @public */ menuItems?: Array<{ /** * @docid * @type_function_param2 itemData:object * @type_function_return void */ action?: ((itemElement: DxElement, itemData: any) => any); /** * @docid */ text?: string; }>; /** * @docid * @type Enums.ListMenuMode * @default 'context' * @default 'slide' &for(iOS) * @public */ menuMode?: 'context' | 'slide'; /** * @docid * @default "More" * @public */ nextButtonText?: string; /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 groupData:object * @type_function_param1_field5 groupElement:DxElement * @type_function_param1_field6 groupIndex:number * @type_function_param1_field1 component:dxList * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onGroupRendered?: ((e: GroupRenderedEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 itemData:object * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field6 itemIndex:number | object * @type_function_param1_field7 event:event * @type_function_param1_field1 component:dxList * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onItemClick?: ((e: ItemClickEvent) => void) | string; /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 itemData:object * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field6 itemIndex:number | object * @type_function_param1_field7 event:event * @type_function_param1_field1 component:dxList * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onItemContextMenu?: ((e: ItemContextMenuEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 itemData:object * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field6 itemIndex:number | object * @type_function_param1_field1 component:dxList * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @hidden false * @public */ onItemDeleted?: ((e: ItemDeletedEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 itemData:object * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field6 itemIndex:number | object * @type_function_param1_field7 cancel:boolean | Promise * @type_function_param1_field1 component:dxList * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @hidden false * @public */ onItemDeleting?: ((e: ItemDeletingEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 itemData:object * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field6 itemIndex:number | object * @type_function_param1_field7 event:event * @type_function_param1_field1 component:dxList * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onItemHold?: ((e: ItemHoldEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 itemData:object * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field6 itemIndex:number | object * @type_function_param1_field7 fromIndex:number * @type_function_param1_field8 toIndex:number * @type_function_param1_field1 component:dxList * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @hidden false * @public */ onItemReordered?: ((e: ItemReorderedEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 event:event * @type_function_param1_field5 itemData:object * @type_function_param1_field6 itemElement:DxElement * @type_function_param1_field7 itemIndex:number | object * @type_function_param1_field8 direction:string * @type_function_param1_field1 component:dxList * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onItemSwipe?: ((e: ItemSwipeEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field1 component:dxList * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onPageLoading?: ((e: PageLoadingEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field1 component:dxList * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onPullRefresh?: ((e: PullRefreshEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 event:event * @type_function_param1_field5 scrollOffset:object * @type_function_param1_field6 reachedLeft:boolean * @type_function_param1_field7 reachedRight:boolean * @type_function_param1_field8 reachedTop:boolean * @type_function_param1_field9 reachedBottom:boolean * @type_function_param1_field1 component:dxList * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onScroll?: ((e: ScrollEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 value:boolean * @type_function_param1_field1 component:dxList * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onSelectAllValueChanged?: ((e: SelectAllValueChangedEvent) => void); /** * @docid * @type Enums.ListPageLoadMode * @default "scrollBottom" * @default "nextButton" &for(desktop except Mac) * @public */ pageLoadMode?: 'nextButton' | 'scrollBottom'; /** * @docid * @default "Loading..." * @default "" &for(Material) * @public */ pageLoadingText?: string; /** * @docid * @default false * @public */ pullRefreshEnabled?: boolean; /** * @docid * @default "Release to refresh..." * @default "" &for(Material) * @public */ pulledDownText?: string; /** * @docid * @default "Pull down to refresh..." * @default "" &for(Material) * @public */ pullingDownText?: string; /** * @docid * @default "Refreshing..." * @default "" &for(Material) * @public */ refreshingText?: string; /** * @docid * @default false * @public */ repaintChangesOnly?: boolean; /** * @docid * @default true * @default false &for(non-touch_devices) * @public */ scrollByContent?: boolean; /** * @docid * @default false * @default true &for(desktop) * @public */ scrollByThumb?: boolean; /** * @docid * @default true * @public */ scrollingEnabled?: boolean; /** * @docid * @type Enums.SelectAllMode * @default 'page' * @public */ selectAllMode?: 'allPages' | 'page'; /** * @docid * @type Enums.ListSelectionMode * @default 'none' * @public */ selectionMode?: 'all' | 'multiple' | 'none' | 'single'; /** * @docid * @type Enums.ShowScrollbarMode * @default 'onScroll' * @default 'onHover' &for(desktop) * @public */ showScrollbar?: 'always' | 'never' | 'onHover' | 'onScroll'; /** * @docid * @default false * @public */ showSelectionControls?: boolean; /** * @docid * @default false &for(desktop except Mac) * @default true * @public */ useNativeScrolling?: boolean; } /** * @docid * @inherits CollectionWidget, SearchBoxMixin * @namespace DevExpress.ui * @public */ export default class dxList extends CollectionWidget { constructor(element: UserDefinedElement, options?: dxListOptions) /** * @docid * @publicName clientHeight() * @return numeric * @public */ clientHeight(): number; /** * @docid * @publicName collapseGroup(groupIndex) * @return Promise * @public */ collapseGroup(groupIndex: number): DxPromise; /** * @docid * @publicName deleteItem(itemElement) * @return Promise * @public */ deleteItem(itemElement: Element): DxPromise; /** * @docid * @publicName deleteItem(itemIndex) * @param1 itemIndex:Number|Object * @return Promise * @public */ deleteItem(itemIndex: number | any): DxPromise; /** * @docid * @publicName expandGroup(groupIndex) * @return Promise * @public */ expandGroup(groupIndex: number): DxPromise; /** * @docid * @publicName isItemSelected(itemElement) * @public */ isItemSelected(itemElement: Element): boolean; /** * @docid * @publicName isItemSelected(itemIndex) * @param1 itemIndex:Number|Object * @public */ isItemSelected(itemIndex: number | any): boolean; /** * @docid * @publicName reload() * @public */ reload(): void; /** * @docid * @publicName reorderItem(itemElement, toItemElement) * @return Promise * @public */ reorderItem(itemElement: Element, toItemElement: Element): DxPromise; /** * @docid * @publicName reorderItem(itemIndex, toItemIndex) * @param1 itemIndex:Number|Object * @param2 toItemIndex:Number|Object * @return Promise * @public */ reorderItem(itemIndex: number | any, toItemIndex: number | any): DxPromise; /** * @docid * @publicName scrollBy(distance) * @param1 distance:numeric * @public */ scrollBy(distance: number): void; /** * @docid * @publicName scrollHeight() * @return numeric * @public */ scrollHeight(): number; /** * @docid * @publicName scrollTo(location) * @param1 location:numeric * @public */ scrollTo(location: number): void; /** * @docid * @publicName scrollToItem(itemElement) * @public */ scrollToItem(itemElement: Element): void; /** * @docid * @publicName scrollToItem(itemIndex) * @param1 itemIndex:Number|Object * @public */ scrollToItem(itemIndex: number | any): void; /** * @docid * @publicName scrollTop() * @return numeric * @public */ scrollTop(): number; /** * @docid * @publicName selectAll() * @public */ selectAll(): void; /** * @docid * @publicName selectItem(itemElement) * @public */ selectItem(itemElement: Element): void; /** * @docid * @publicName selectItem(itemIndex) * @param1 itemIndex:Number|Object * @public */ selectItem(itemIndex: number | any): void; /** * @docid * @publicName unselectAll() * @public */ unselectAll(): void; /** * @docid * @publicName unselectItem(itemElement) * @public */ unselectItem(itemElement: Element): void; /** * @docid * @publicName unselectItem(itemIndex) * @param1 itemIndex:Number|Object * @public */ unselectItem(itemIndex: number | any): void; /** * @docid * @publicName updateDimensions() * @return Promise * @public */ updateDimensions(): DxPromise; } /** * @public * @namespace DevExpress.ui.dxList */ export type Item = dxListItem; /** * @deprecated Use Item instead * @namespace DevExpress.ui */ export interface dxListItem extends CollectionWidgetItem { /** * @docid * @public */ badge?: string; /** * @docid * @public */ icon?: string; /** * @docid * @public */ key?: string; /** * @docid * @public */ showChevron?: boolean; } /** @public */ export type Properties = dxListOptions; /** @deprecated use Properties instead */ export type Options = dxListOptions; /** @deprecated use Properties instead */ export type IOptions = dxListOptions;