/** * DevExtreme (ui/collection/ui.collection_widget.base.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 DataSource, { Options as DataSourceOptions, } from '../../data/data_source'; import Store from '../../data/abstract_store'; import { EventInfo, NativeEventInfo, ItemInfo, } from '../../events/index'; import Widget, { WidgetOptions, } from '../widget/ui.widget'; export interface SelectionChangedInfo { readonly addedItems: Array; readonly removedItems: Array; } /** @namespace DevExpress.ui */ export interface CollectionWidgetOptions extends WidgetOptions { /** * @docid * @default null * @public */ dataSource?: string | Array | Store | DataSource | DataSourceOptions; /** * @docid * @default 750 * @public */ itemHoldTimeout?: number; /** * @docid * @default "item" * @type_function_param1 itemData:object * @type_function_return string|Element|jQuery * @public */ itemTemplate?: template | ((itemData: any, itemIndex: number, itemElement: DxElement) => string | UserDefinedElement); /** * @docid * @fires CollectionWidgetOptions.onOptionChanged * @public */ items?: Array; /** * @docid * @default null * @public */ keyExpr?: string | Function; /** * @docid * @default "No data to display" * @public */ noDataText?: 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 * @type_function_param1_field7 event:event * @type_function_param1_field1 component:this * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onItemClick?: ((e: NativeEventInfo & ItemInfo) => 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 * @type_function_param1_field7 event:event * @type_function_param1_field1 component:this * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onItemContextMenu?: ((e: NativeEventInfo & ItemInfo) => 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 * @type_function_param1_field7 event:event * @type_function_param1_field1 component:this * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onItemHold?: ((e: NativeEventInfo & ItemInfo) => 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 * @type_function_param1_field1 component:this * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onItemRendered?: ((e: EventInfo & ItemInfo) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 addedItems:array * @type_function_param1_field5 removedItems:array * @type_function_param1_field1 component:this * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onSelectionChanged?: ((e: EventInfo & SelectionChangedInfo) => void); /** * @docid * @default -1 * @fires CollectionWidgetOptions.onSelectionChanged * @public */ selectedIndex?: number; /** * @docid * @default null * @fires CollectionWidgetOptions.onSelectionChanged * @ref * @public */ selectedItem?: any; /** * @docid * @fires CollectionWidgetOptions.onSelectionChanged * @public */ selectedItemKeys?: Array; /** * @docid * @fires CollectionWidgetOptions.onSelectionChanged * @public */ selectedItems?: Array; } /** * @docid * @inherits Widget, DataHelperMixin * @hidden * @namespace DevExpress.ui */ export default class CollectionWidget extends Widget { constructor(element: UserDefinedElement, options?: CollectionWidgetOptions) getDataSource(): DataSource; } /** * @docid * @type object * @namespace DevExpress.ui */ export interface CollectionWidgetItem { /** * @docid * @default false * @public */ disabled?: boolean; /** * @docid * @public */ html?: string; /** * @docid * @type_function_return string|Element|jQuery * @public */ template?: template | ((itemData: any, itemIndex: number, itemElement: DxElement) => string | UserDefinedElement); /** * @docid * @public */ text?: string; /** * @docid * @default true * @public */ visible?: boolean; }