@progress/kendo-react-grid
Version:
KendoReact Grid package
174 lines (173 loc) • 4.15 kB
TypeScript
/// <reference types="react" />
import { SortDescriptor, CompositeFilterDescriptor, GroupDescriptor, State } from '@progress/kendo-data-query';
import { Grid } from '../Grid';
import { Page } from '../paging/Page';
import { GridColumnProps } from './GridColumnProps';
/**
* Represents the base event object of the Grid.
*/
export interface GridEvent {
/**
* An event target.
*/
target: Grid;
/**
* A React Synthetic Event.
*/
syntheticEvent: React.SyntheticEvent<any>;
/**
* A native DOM event.
*/
nativeEvent: any;
}
/**
* Represents the object of the `onPageChange` Grid event.
*/
export interface GridPageChangeEvent extends GridEvent {
page: Page;
}
/**
* The returned type of the `onDataStateChange` Grid event.
*/
export interface GridDataStateChangeEvent extends GridEvent {
/**
* The state of the Grid based on the user action.
*/
data: State;
}
/**
* Represents the object of the `onSortChange` Grid event.
*/
export interface GridSortChangeEvent extends GridEvent {
/**
* The new `SortDescriptor` according to the user action.
*/
sort: SortDescriptor[];
}
/**
* Represents the object of the `onFilterChange` Grid event.
*/
export interface GridFilterChangeEvent extends GridEvent {
/**
* The new `CompositeFilterDescriptor` based on the user action.
*/
filter: CompositeFilterDescriptor;
}
/**
* Represents the object of the `onGroupChange` Grid event.
*/
export interface GridGroupChangeEvent extends GridEvent {
/**
* An array of `GroupDescriptor` that corresponds to the user action.
*/
group: GroupDescriptor[];
}
/**
* Represents the object of the `onEpandChange` Grid event.
*/
export interface GridExpandChangeEvent extends GridEvent {
/**
* The data item that is expanded or collapsed.
*/
dataItem: any;
/**
* The available values are:
* - `true`—If the data item is expanded.
* - `false`—If the data item is collapsed.
*/
value: boolean;
}
/**
* Represents the object of the `onSelectionChange` Grid event.
*/
export interface GridSelectionChangeEvent extends GridEvent {
/**
* The data item which was selected or deselected.
*/
dataItem: any;
}
/**
* Represents the object of the `onItemChange` Grid event.
*/
export interface GridItemChangeEvent extends GridEvent {
/**
* The data object that represents the current row.
*/
dataItem: any;
/**
* The field to which the row is bound.
*/
field?: string;
/**
* The value of the item.
*/
value: any;
}
/**
* Represents the object of the `onHeaderSelectionChange` Grid event.
*/
export interface GridHeaderSelectionChangeEvent extends GridEvent {
/**
* The field of the column in which the cell is located.
*/
field?: string;
}
/**
* Represents the object of the `onRowClick` Grid event.
*/
export interface GridRowClickEvent extends GridEvent {
/**
* The item from the `data` property of the Grid which corresponds to the row that is clicked.
*/
dataItem: any;
}
/**
* Represents the object of the `onColumnResize` Grid event.
*/
export interface GridColumnResizeEvent {
/**
* An event target.
*/
target: Grid;
/**
* A native DOM event.
*/
nativeEvent: any;
/**
* The current columns collection.
*/
columns: GridColumnProps[];
/**
* The index of the column.
*/
index: number;
/**
* The new width of the column.
*/
newWidth: number;
/**
* The actual width of the column prior to resizing.
*/
oldWidth: number;
/**
* Indicates that resizing is complete and the user has dropped the resize handler.
*/
end: boolean;
}
/**
* Represents the object of the `onColumnReorder` Grid event.
*/
export interface GridColumnReorderEvent {
/**
* An event target.
*/
target: Grid;
/**
* A native DOM event.
*/
nativeEvent: any;
/**
* The current columns collection.
*/
columns: GridColumnProps[];
}