diff --git a/packages/devextreme-angular/src/ui/nested/base/text-editor-button-dxi.ts b/packages/devextreme-angular/src/ui/nested/base/text-editor-button-dxi.ts index 0546c113f483..01faf3831bfa 100644 --- a/packages/devextreme-angular/src/ui/nested/base/text-editor-button-dxi.ts +++ b/packages/devextreme-angular/src/ui/nested/base/text-editor-button-dxi.ts @@ -6,6 +6,7 @@ import { } from '@angular/core'; import { dxButtonOptions } from 'devextreme/ui/button'; +import { ColumnButtonClickEvent } from 'devextreme/ui/data_grid'; @Component({ template: '' @@ -60,10 +61,10 @@ export abstract class DxiTextEditorButton extends CollectionNestedOption { this._setOption('icon', value); } - get onClick(): Function { + get onClick(): ((e: ColumnButtonClickEvent) => void) { return this._getOption('onClick'); } - set onClick(value: Function) { + set onClick(value: ((e: ColumnButtonClickEvent) => void)) { this._setOption('onClick', value); } diff --git a/packages/devextreme-react/src/data-grid.ts b/packages/devextreme-react/src/data-grid.ts index a6d8d5610228..74fe3aa9455d 100644 --- a/packages/devextreme-react/src/data-grid.ts +++ b/packages/devextreme-react/src/data-grid.ts @@ -7,17 +7,17 @@ import * as PropTypes from "prop-types"; import { Component as BaseComponent, IHtmlOptions } from "./core/component"; import NestedOption from "./core/nested-option"; -import type { dxDataGridColumn, AdaptiveDetailRowPreparingEvent, CellClickEvent, CellDblClickEvent, CellPreparedEvent, ContentReadyEvent, ContextMenuPreparingEvent, DataErrorOccurredEvent, DisposingEvent, EditCanceledEvent, EditCancelingEvent, EditingStartEvent, EditorPreparedEvent, EditorPreparingEvent, ExportingEvent, FocusedCellChangingEvent, FocusedRowChangingEvent, InitializedEvent, InitNewRowEvent, KeyDownEvent, RowClickEvent, RowCollapsedEvent, RowCollapsingEvent, RowDblClickEvent, RowExpandedEvent, RowExpandingEvent, RowInsertedEvent, RowInsertingEvent, RowPreparedEvent, RowRemovedEvent, RowRemovingEvent, RowUpdatedEvent, RowUpdatingEvent, RowValidatingEvent, SavedEvent, SavingEvent, ToolbarPreparingEvent, dxDataGridRowObject, dxDataGridColumnButton, dxDataGridToolbarItem } from "devextreme/ui/data_grid"; +import type { dxDataGridColumn, AdaptiveDetailRowPreparingEvent, CellClickEvent, CellDblClickEvent, CellPreparedEvent, ContentReadyEvent, ContextMenuPreparingEvent, DataErrorOccurredEvent, DisposingEvent, EditCanceledEvent, EditCancelingEvent, EditingStartEvent, EditorPreparedEvent, EditorPreparingEvent, ExportingEvent, FocusedCellChangingEvent, FocusedRowChangingEvent, InitializedEvent, InitNewRowEvent, KeyDownEvent, RowClickEvent, RowCollapsedEvent, RowCollapsingEvent, RowDblClickEvent, RowExpandedEvent, RowExpandingEvent, RowInsertedEvent, RowInsertingEvent, RowPreparedEvent, RowRemovedEvent, RowRemovingEvent, RowUpdatedEvent, RowUpdatingEvent, RowValidatingEvent, SavedEvent, SavingEvent, ToolbarPreparingEvent, dxDataGridRowObject, ColumnButtonClickEvent, dxDataGridColumnButton, dxDataGridToolbarItem } from "devextreme/ui/data_grid"; import type { DataChange, ColumnHeaderFilterSearchConfig, ColumnChooserSearchConfig, ColumnChooserSelectionConfig, HeaderFilterSearchConfig, GridBase } from "devextreme/common/grids"; import type { ContentReadyEvent as FilterBuilderContentReadyEvent, DisposingEvent as FilterBuilderDisposingEvent, EditorPreparedEvent as FilterBuilderEditorPreparedEvent, EditorPreparingEvent as FilterBuilderEditorPreparingEvent, InitializedEvent as FilterBuilderInitializedEvent, dxFilterBuilderField, dxFilterBuilderCustomOperation, OptionChangedEvent, ValueChangedEvent } from "devextreme/ui/filter_builder"; import type { ContentReadyEvent as FormContentReadyEvent, DisposingEvent as FormDisposingEvent, InitializedEvent as FormInitializedEvent, dxFormSimpleItem, dxFormOptions, OptionChangedEvent as FormOptionChangedEvent, dxFormGroupItem, dxFormTabbedItem, dxFormEmptyItem, dxFormButtonItem, EditorEnterKeyEvent, FieldDataChangedEvent } from "devextreme/ui/form"; import type { AnimationConfig, AnimationState } from "devextreme/animation/fx"; -import type { event, EventInfo } from "devextreme/events/index"; import type { template } from "devextreme/core/templates/template"; import type { DataSourceOptions } from "devextreme/data/data_source"; import type { Store } from "devextreme/data/abstract_store"; import type { PositionConfig } from "devextreme/animation/position"; import type { dxPopupOptions, dxPopupToolbarItem } from "devextreme/ui/popup"; +import type { event, EventInfo } from "devextreme/events/index"; import type { Component } from "devextreme/core/component"; import type { CollectionWidgetItem } from "devextreme/ui/collection/ui.collection_widget.base"; @@ -403,7 +403,7 @@ type IButtonProps = React.PropsWithChildren<{ hint?: string; icon?: string; name?: "cancel" | "delete" | "edit" | "save" | "undelete"; - onClick?: ((e: { column: dxDataGridColumn, component: dxDataGrid, element: any, event: event, model: Record, row: dxDataGridRowObject }) => void); + onClick?: ((e: ColumnButtonClickEvent) => void); template?: ((cellElement: any, cellInfo: { column: dxDataGridColumn, columnIndex: number, component: dxDataGrid, data: Record, key: any, row: dxDataGridRowObject, rowIndex: number, rowType: string }) => string | any) | template; text?: string; visible?: boolean | ((options: { column: dxDataGridColumn, component: dxDataGrid, row: dxDataGridRowObject }) => boolean); diff --git a/packages/devextreme/js/ui/data_grid.d.ts b/packages/devextreme/js/ui/data_grid.d.ts index e18d3ab6d8e7..5f53ef748fbe 100644 --- a/packages/devextreme/js/ui/data_grid.d.ts +++ b/packages/devextreme/js/ui/data_grid.d.ts @@ -1035,9 +1035,22 @@ export type RowDraggingRemoveEvent = ReducedNativeEv /** @public */ export type RowDraggingReorderEvent = ReducedNativeEventInfo> & RowDraggingEventInfo & DragReorderInfo; -/** @public */ +/** + * @docid _ui_data_grid_ColumnButtonClickEvent + * @public + * @type object + * @inherits NativeEventInfo + */ export type ColumnButtonClickEvent = NativeEventInfo, PointerEvent | MouseEvent> & { + /** + * @docid _ui_data_grid_ColumnButtonClickEvent.row + * @type dxDataGridRowObject + */ row?: Row; + /** + * @docid _ui_data_grid_ColumnButtonClickEvent.column + * @type dxDataGridColumn + */ column?: Column; }; @@ -2303,12 +2316,7 @@ export interface dxDataGridColumnButton extends Colu name?: DataGridPredefinedColumnButton | string; /** * @docid dxDataGridColumnButton.onClick - * @type_function_param1 e:object - * @type_function_param1_field component:dxDataGrid - * @type_function_param1_field model:object - * @type_function_param1_field event:event - * @type_function_param1_field row:dxDataGridRowObject - * @type_function_param1_field column:dxDataGridColumn + * @type_function_param1 e:{ui/data_grid:ColumnButtonClickEvent} * @public */ onClick?: ((e: ColumnButtonClickEvent) => void); diff --git a/packages/devextreme/ts/dx.all.d.ts b/packages/devextreme/ts/dx.all.d.ts index 25bf6da99977..95eb1fbb2f7b 100644 --- a/packages/devextreme/ts/dx.all.d.ts +++ b/packages/devextreme/ts/dx.all.d.ts @@ -9985,6 +9985,9 @@ declare module DevExpress.ui { * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type ColumnButtonBase = DevExpress.common.grids.ColumnButtonBase; + /** + * [descr:_ui_data_grid_ColumnButtonClickEvent] + */ export type ColumnButtonClickEvent< TRowData = any, TKey = any @@ -9992,7 +9995,13 @@ declare module DevExpress.ui { dxDataGrid, PointerEvent | MouseEvent > & { + /** + * [descr:_ui_data_grid_ColumnButtonClickEvent.row] + */ row?: Row; + /** + * [descr:_ui_data_grid_ColumnButtonClickEvent.column] + */ column?: Column; }; export type ColumnButtonTemplateData = {