smart-webcomponents
Version:
Web Components & Custom Elements for Professional Web Applications
608 lines (606 loc) • 292 kB
TypeScript
import {BaseElement, Animation} from "./smart.element"
import {DataAdapter} from "./smart.dataadapter"
import {Chart} from "./smart.chart"
export interface GridProperties {
/**
* An object that defines configurable options for customizing the visual appearance of the grid, including properties such as line color, spacing, background style, and border visibility.
* Default value: [object Object]
*/
appearance?: GridAppearance;
/**
* An object that defines configuration options for integrating AI capabilities within the grid component. This includes settings for enabling AI features, specifying AI service endpoints, setting authentication credentials, and customizing how the grid interacts with AI-powered functionalities.
* Default value: [object Object]
*/
ai?: GridAi;
/**
* An object that defines configuration options controlling the grid’s behavior, such as layout properties, sorting and filtering capabilities, selection modes, and responsiveness settings.
* Default value: [object Object]
*/
behavior?: GridBehavior;
/**
* Sets or retrieves the id of the currently active user. This value must match the id of one of the entries in the users property or array. The active user's privileges and access rights are determined based on their corresponding user object. If no current user is specified (i.e., the id is unset or invalid), the default privileges for the element will apply according to its properties, potentially restricting or allowing access based on default settings.
* Default value:
*/
currentUser?: string | number;
/**
* Provides configuration options for customizing the appearance, labels, alignment, and behavior of column headers in a data table or grid.
* Default value: [object Object]
*/
columnHeader?: GridColumnHeader;
/**
* The clipboard property controls whether users can perform clipboard operations—such as copying (Ctrl+C), cutting (Ctrl+X), and pasting (Ctrl+V)—using keyboard shortcuts within the application. Setting this property to true enables these keyboard shortcuts for clipboard actions; setting it to false disables them, preventing users from using keyboard navigation for copying, cutting, or pasting content.
* Default value: [object Object]
*/
clipboard?: GridClipboard;
/**
* The columns property defines the collection of columns displayed within the Smart.Grid component. Each column configuration specifies how data is presented and interacted with. Through this property, you can control essential aspects such as column headers, data field bindings, sorting, filtering, formatting, alignment, visibility, and more. The columns property gives you full control over the structure, appearance, and behavior of the grid's columns, enabling advanced customization of both data presentation and user experience.
* Default value: []
*/
columns?: {label: string, dataField: string}[] | string[] | number | GridColumn[];
/**
* The Context Menu is the drop-down menu that appears when a user right-clicks on a row within the Grid. This menu provides quick access to actions such as deleting a row or editing a cell or entire row, depending on the current editing mode configured for the Grid. You can customize the Context Menu by using the 'contextMenuItemCustom' option in the Grid's dataSource. This option lets you add your own custom menu items to enhance or extend the menu's functionality.Additionally, if you want to completely replace the default context menu with your own, you can use the 'selector' property. Set this property to the ID of a Smart.Menu component to display your custom menu when the user right-clicks on a row in the Grid.
* Default value: [object Object]
*/
contextMenu?: GridContextMenu;
/**
* The Column Menu is a contextual drop-down menu that appears when you click the drop-down button in a column header, which becomes visible upon hovering over the header. This menu provides various options for customizing the behavior and appearance of the selected column. Common actions include sorting the grid by the column, applying filters to show or hide specific data, and grouping the grid rows based on the column’s values. The Column Menu offers an intuitive way for users to interact with and tailor the data grid to meet their specific needs.
* Default value: [object Object]
*/
columnMenu?: GridColumnMenu;
/**
* Provides a detailed configuration of column group settings, including group names, ordering, visibility, and any hierarchical relationships between columns within the group.
* Default value:
*/
columnGroups?: GridColumnGroup[];
/**
*
* Default value: false
*/
dropDownMode?: boolean;
/**
* Defines or retrieves the rules and settings for conditional formatting applied to the Grid's cells, allowing you to customize cell appearance (such as background color, font style, or icons) based on specific conditions or cell values.
* Default value: null
*/
conditionalFormatting?: GridConditionalFormatting[];
/**
* Configures the data and display settings for the Grid Chart, enabling data visualization in a tabular grid format. This includes specifying the structure, appearance, and interactive features of the chart to present complex data clearly and intuitively.
* Default value: [object Object]
*/
charting?: GridCharting;
/**
* Configures the checkbox options for the TreeGrid component, allowing you to enable or customize checkbox display, selection behavior, and interaction within the hierarchical grid structure.
* Default value: [object Object]
*/
checkBoxes?: GridCheckBoxes;
/**
* Configures the export settings for grid data, including file format, selected columns, data range, export style, and additional export preferences.
* Default value: [object Object]
*/
dataExport?: GridDataExport;
/**
* Specifies the source from which the grid retrieves its data. The dataSource property accepts either an instance of JQX.DataAdapter for advanced data management and operations, or a standard Array containing the data records to be displayed in the grid. This flexibility allows developers to connect the grid to various data formats and structures, making data binding straightforward and versatile.
* Default value: null
*/
dataSource?: any;
/**
* Configures the grid’s data source when the dataSource property is assigned either a JavaScript array (for local data) or a URL (for remote data). This setting determines how the grid retrieves and displays its data, supporting both direct array binding and remote data fetching via HTTP requests.
* Default value: [object Object]
*/
dataSourceSettings?: GridDataSourceSettings;
/**
* Provides comprehensive configuration options for controlling the grid's editing behavior, including enabling or disabling editing features, specifying editing modes (such as inline, popup, or batch), setting validation rules, and customizing editors for specific columns.
* Default value: [object Object]
*/
editing?: GridEditing;
/**
* Provides detailed configuration options for the grid's filtering functionality, including filter types, default filter values, filter operators, and custom filter logic for columns. This determines how data within the grid can be searched, narrowed, or displayed based on user-defined criteria.
* Default value: [object Object]
*/
filtering?: GridFiltering;
/**
* Provides configuration options for customizing the appearance and behavior of the grid's footer, including visibility, content, styling, and layout settings.
* Default value: [object Object]
*/
footer?: GridFooter;
/**
* Enables or retrieves the ability to use Excel-style formulas as cell values within the table. Formulas must begin with an equal sign (=) and will be automatically recalculated whenever the referenced cell values are updated. This functionality relies on the third-party, free formula-parser plugin, so you must include the file 'formula-parser.min.js' in your project for this feature to work properly.
* Default value: false
*/
formulas?: boolean;
/**
* Provides detailed configuration options for the grid's data grouping functionality, specifying how rows are grouped, the grouping criteria, and related display settings within the grid.
* Default value: [object Object]
*/
grouping?: GridGrouping;
/**
* Provides configuration options that define the appearance and behavior of the group header, including properties such as text, style, alignment, and visibility settings.
* Default value: [object Object]
*/
groupHeader?: GridGroupHeader;
/**
* Provides detailed configuration options for the grid's header, including display settings, styling, visibility, and customization of header rows and columns.
* Default value: [object Object]
*/
header?: GridHeader;
/**
* An object that defines configuration options for the layout of the grid, including properties such as the number of columns, row and column spacing, alignment, and overall grid arrangement. This object allows you to customize the appearance and structure of the grid according to your requirements.
* Default value: [object Object]
*/
layout?: GridLayout;
/**
* Sets or retrieves the unlockKey used to authorize and access the full functionality of the product. The unlockKey serves as a security credential to enable locked or premium features.
* Default value: ""
*/
unlockKey?: string;
/**
* Specifies the language code to be used for displaying messages. When set, it determines which localized messages from the messages property are shown to the user. This property can be used to retrieve the current language or update it dynamically at runtime.
* Default value: "en"
*/
locale?: string;
/**
* 'Key Handling:' You can customize how key presses are handled by defining key mappings within the configuration. For each key (e.g., '"Enter"'), you can assign:- 'Another key as the value' (e.g., '"Enter": "Tab"'): When the specified key is pressed, it will be treated as if the mapped key was pressed instead.- 'A predefined action' (e.g., ''copy'', ''copyPrev'', ''copyNext'', ''delete''): When the key is pressed, the associated action will be executed.- 'A custom function': Assign a function as the value to execute custom logic whenever the key is pressed.This allows you to remap keys, trigger built-in actions, or define entirely custom behaviors based on key events in your application.
* Default value: null
*/
keys?: any;
/**
* Assigns values to the messages property, which typically contains an array or object representing individual messages or notifications. This function or setting updates the content, ensuring that the correct message data is stored or displayed.
* Default value: * [object Object]
*/
messages?: any;
/**
* Callback function invoked each time the Grid component requires a cell value for rendering. By implementing this function, you can customize or override the default logic used to retrieve and display cell values, enabling support for computed values, formatted data, or specialized rendering based on row or column context.
* Default value: null
*/
onCellValue?: {(cell: GridCell): void};
/**
* Callback function that is triggered whenever a cell's value is about to be updated. You can use this function, for example, to perform an Ajax call to your server in order to validate or process the proposed cell changes before they are applied. If the server response indicates that the changes are valid, call the confirm function provided in the callback to finalize and apply the update. This allows for asynchronous validation and external control over cell modification in your data grid.
* Default value: null
*/
onCellUpdate?: {(cells: GridCell[], oldValues: any[], values: any[], confirm: {(commit: boolean): void}): void};
/**
* A callback function that is invoked each time a cell is rendered in the grid. Use this function to modify or customize the properties of the GridCell before it is displayed to the user. This allows you to dynamically apply styles, set attributes, or inject content based on the cell's data or state.
* Default value: null
*/
onCellRender?: {(cell: GridCell): void};
/**
* A callback function that is triggered when a cell enters edit mode. This function allows you to implement custom logic before editing begins. If the function returns false, the cell edit operation will be canceled and the cell will remain in its previous state. Use this to validate whether editing should be permitted based on your criteria.
* Default value: null
*/
onCellBeginEdit?: {(id: string, dataField: string, value: any): boolean};
/**
* A callback function that is triggered when a cell editing operation finishes in the Grid. This function is typically used together with the 'editing.readOnlyEdit' property set to true, which allows cells to appear read-only but still be editable through custom logic. The primary purpose of this callback is to handle post-editing actions, such as validating the input, processing changes, or updating the cell value in the Grid after the editing session ends. Use this function to programmatically update the data source or UI based on the user’s edits.
* Default value: null
*/
onCellEditRequest?: {(id: string, dataField: string, value: any, oldValue: any, data: any): void};
/**
* Invoked whenever a cell's value is updated, this callback function receives relevant information about the change—such as the new value, the previous value, and cell metadata—allowing you to handle updates, trigger side effects, or implement custom logic in response to user edits.
* Default value: null
*/
onCellValueChanged?: {(id: string, dataField: string, value: any): boolean};
/**
* Callback function that is executed before the grid initialization process begins. At this stage, the Grid's Virtual DOM has not yet been created, so any DOM manipulations or operations on grid elements should be avoided within this callback. Use this function to perform setup tasks or configure options that need to occur prior to the creation of the grid's internal structure.
* Default value: null
*/
onBeforeInit?: {(): void};
/**
* Callback function invoked during the grid initialization process, specifically after the Grid's Virtual DOM has been created. This allows you to perform custom actions or setup logic once the grid structure is ready in the DOM, but before it is rendered to the user.
* Default value: null
*/
onInit?: {(): void};
/**
* Callback function that is executed after the grid has completed initialization and its Virtual DOM has been fully constructed. This allows you to perform any additional setup or actions that require the grid and its DOM elements to be ready.
* Default value: null
*/
onAfterInit?: {(): void};
/**
* Callback function (chart: JQX.Chart) invoked after the chart has been fully initialized. Use this function to perform additional configuration or customization of the chart instance, such as modifying chart options, adding event listeners, or updating data before the chart is rendered to the user. This allows you to tailor the chart's appearance and behavior to meet specific application requirements.
* Default value: null
*/
onChartInit?: any;
/**
* A callback function that is executed immediately after the grid has finished rendering, allowing you to perform additional actions or updates once the grid display is complete.
* Default value: null
*/
onRender?: any;
/**
* Callback function invoked after the grid has been rendered for the first time and all data bindings have been completed. At this point, the component is fully initialized and ready for interaction or further manipulation.
* Default value: null
*/
onLoad?: any;
/**
* Callback function (event: KeyboardEvent) that is invoked whenever the grid component has focus and the user presses any keyboard key. This function allows you to handle and respond to keyboard interactions within the grid, accessing the pressed key and related event properties via the KeyboardEvent object.
* Default value: null
*/
onKey?: {(event: KeyboardEvent): void};
/**
* Callback function invoked during the initialization of a row. Use this function to customize row properties, apply conditional logic, or modify row data before it is rendered. The function receives the row's data and context as parameters, allowing for dynamic adjustments based on specific requirements.
* Default value: null
*/
onRowInit?: {(index: number, row: GridRow): void};
/**
* Callback function invoked during the initialization of a row’s detail section. This function is triggered before the row detail is rendered, allowing you to customize or modify the detail content. Row details can be displayed either directly beneath the associated row in the main data table, or within a separate dialog window, depending on the configuration.
* Default value: null
*/
onRowDetailInit?: {(index: number, row: GridRow, details: HTMLElement): void};
/**
* Callback function that is invoked when the details of a table row are being updated. This function allows you to implement custom logic or handle events during the row detail update process.
* Default value: null
*/
onRowDetailUpdated?: {(index: number, row: GridRow, details: HTMLElement): void};
/**
* A callback function that is triggered whenever a row’s edit history is updated. This function is invoked only if the 'storeHistory' property is enabled, ensuring that all changes made to a row are recorded. Use this callback to handle actions such as syncing changes, auditing edits, or updating related UI components whenever a row’s edit history changes.
* Default value: null
*/
onRowHistory?: {(index: number, row: GridRow, history: any[]): void};
/**
* Callback function triggered when the style of a row is updated. This event occurs whenever a row's styling changes, either through the row dialog interface or programmatically via the setRowStyle method. The callback receives relevant information about the updated row and its new style, enabling custom handling or additional processing in response to the style change.
* Default value: null
*/
onRowStyle?: {(index: number, row: GridRow, history: any[]): void};
/**
* Callback function that is executed immediately after a new row has been successfully inserted. It receives relevant information about the newly inserted row as arguments, allowing you to perform custom actions or post-processing in response to the insertion event.
* Default value: null
*/
onRowInserted?: {(index: number[], row: GridRow[]): void};
/**
* A callback function that is executed immediately after a row has been successfully removed from the data set or table. This function receives relevant information about the removed row, allowing you to perform custom actions such as updating the UI, triggering notifications, or handling related cleanup tasks.
* Default value: null
*/
onRowRemoved?: {(indexes: number[], rows: GridRow[]): void};
/**
* Callback function triggered when a row's cell values are updated. Use this function to perform custom actions—such as making an AJAX request to the server to validate the edited data. After receiving validation results, if the changes are approved, call the confirm function to finalize the update.
* Default value: null
*/
onRowUpdate?: {(index: number[], row: GridRow[], oldValues: any[], values: any[], confirm: {(commit: boolean): void}): void};
/**
* Callback function that is invoked immediately after a row has been updated. Receives the updated row data and additional context as parameters, enabling custom logic or side effects in response to row changes.
* Default value: null
*/
onRowUpdated?: {(index: number[], row: GridRow[]): void};
/**
* This callback function is invoked by the Grid component, if provided, for each row. It is used to determine and return the CSS class name(s) that should be applied to the specific row, allowing for dynamic or conditional styling based on the row data or index.
* Default value: null
*/
onRowClass?: {(index: number, data: any, row: GridRow[]): void};
/**
* "This callback function, when provided to the Grid, is invoked for each cell to determine the CSS class(es) that should be applied. Use this function to dynamically assign one or more CSS classes to individual cells based on their data, state, or other custom logic."
* Default value: null
*/
onCellClass?: {(index: number, dataField: string, cellValue: any, data: any, row: GridRow[]): void};
/**
* Callback function that is invoked after a column has been initialized. This function receives the column instance as a parameter and can be used to modify column properties, apply custom settings, or perform additional setup specific to that column. Use this callback to tailor column behavior or appearance during the initialization process.
* Default value: null
*/
onColumnInit?: {(index: number, column: GridColumn): void};
/**
* Callback function that is invoked whenever a new column is successfully inserted into the structure or component. This function receives relevant information about the inserted column, allowing you to perform custom logic or updates in response to the insertion event.
* Default value: null
*/
onColumnInserted?: {(index: number, column: GridColumn): void};
/**
* Callback function that is triggered after a column has been successfully removed. This function receives relevant information about the removed column as its arguments, allowing you to perform additional actions or updates in response to the removal event.
* Default value: null
*/
onColumnRemoved?: {(index: number, column: GridColumn): void};
/**
* Callback function that is invoked whenever the data in a column is updated. Receives relevant information about the updated column, such as the column identifier and the new value, allowing you to implement custom behavior in response to column changes.
* Default value: null
*/
onColumnUpdated?: {(index: number, column: GridColumn): void};
/**
* Callback function that is invoked immediately after a column has been successfully cloned. This function receives relevant context or event data as its arguments, allowing you to perform custom logic or side effects in response to the cloning action.
* Default value: null
*/
onColumnClone?: {(dataField: string, cloneColumnDataField: string, index: number, duplicateCells: boolean): void};
/**
* Callback function that is triggered when a command is executed. - The name parameter specifies the name of the command. - The command parameter refers to the function that implements the command’s logic. - The details parameter contains the arguments for the command, as provided by the Grid. - The handled parameter is a flag you can set to true within the callback to prevent the Grid from executing the command’s default behavior, allowing you to fully override or customize the command’s handling.
* Default value: null
*/
onCommand?: {(name: string, command: any, details: GridCell, event: Event | KeyboardEvent | PointerEvent, handled: boolean): void};
/**
* Provides detailed configuration options for managing pagination, including parameters such as the number of items per page, current page index, and total number of pages. This section ensures efficient data retrieval and navigation across multiple pages of results.
* Default value: [object Object]
*/
paging?: GridPaging;
/**
* Provides detailed configuration options for pager controls, including settings for page size, navigation buttons, and display style. These options determine how pagination is displayed and how users interact with paged content in the interface.
* Default value: [object Object]
*/
pager?: GridPager;
/**
* Configures or updates the detailed information or content associated with a specific row, often used to display additional data or expanded views for that row.
* Default value: [object Object]
*/
rowDetail?: GridRowDetail;
/**
* Sets or gets the CSS class rules for table rows. This property allows you to conditionally apply different CSS class names to rows based on custom logic. You provide an object where the keys are CSS class names and the values are functions that determine whether the class should be applied to a particular row.Each function receives a settings object with the following properties:- 'index': The numerical index of the current row.- 'data': The data object for the current row.- 'row': The raw row element or reference (depending on the implementation).- 'api': A reference to the table's API for advanced operations.'Example usage:''''jsrowCSSRules: { 'cell-class-1': settings => settings.data.quantity === 5, 'cell-class-2': settings => settings.data.quantity 'cell-class-3': settings => settings.data.quantity > 5}'''In this example, based on the 'quantity' property of the row's data, a different CSS class will be applied to that row. Multiple rules can be defined, and each will be evaluated for every row. If the function returns 'true', the corresponding class will be added to the row.
* Default value: null
*/
rowCSSRules?: any;
/**
* Gets or sets a value that determines whether the element's alignment is configured for right-to-left (RTL) languages, ensuring proper layout and text direction for locales such as Arabic or Hebrew.
* Default value: false
*/
rightToLeft?: boolean;
/**
* The rows property contains an array of objects, with each object representing a single row in the grid. This property defines all the data entries that are rendered and displayed as rows within the grid component. Each element in the rows array should align with the column definitions, ensuring that the grid displays structured and consistent data across all rows.
* Default value:
*/
rows?: GridRow[];
/**
* Configures the scroll mode behavior, allowing you to define how scrolling is handled within the component or page. This setting determines options such as smooth or instant scrolling, vertical or horizontal direction, and any custom scroll-related parameters.
* Default value: physical
*/
scrolling?: Scrolling | string;
/**
* Provides detailed configuration options for displaying and customizing the summary row, including its appearance, position, aggregation methods, and which columns are summarized.
* Default value: [object Object]
*/
summaryRow?: GridSummaryRow;
/**
* Configures the grid's state-related settings, including properties such as selection, sorting, filtering, pagination, and layout. This determines how the grid maintains and restores its current state during user interactions or when the page is reloaded.
* Default value: [object Object]
*/
stateSettings?: GridStateSettings;
/**
* Provides detailed configuration options for user selection behavior, including parameters such as selection mode (single or multiple), default selections, selection limits, and customizable callbacks for selection events.
* Default value: [object Object]
*/
selection?: GridSelection;
/**
* Provides detailed configuration options for controlling how data is sorted, including criteria such as sorting field, order (ascending or descending), and support for multiple sort keys.
* Default value: [object Object]
*/
sorting?: GridSorting;
/**
* Defines the users displayed on the grid. Expects an array of user objects, where each object must include an 'id' (unique identifier) and a 'name' (display name). Optionally, each user object can also include a 'color' (for customizing the user's appearance) and an 'image' (URL or path to the user's avatar image).
* Default value: []
*/
users?: any[];
/**
* Configures the upload settings for images and attachments in the grid's image and attachment columns, including options for file type restrictions, size limits, and image filters to be applied during the upload process.
* Default value: [object Object]
*/
uploadSettings?: GridUploadSettings;
/**
* Specifies the layout mode for displaying data within the interface. Acceptable values are:- ''grid'': Presents items in a tabular, spreadsheet-like format with rows and columns.- ''kanban'': Arranges items into columns representing workflow stages, similar to task boards.- ''card'': Displays each item as an individual card, typically used for concise summaries or visual grouping.Choose one of these values to determine how data is visually organized and presented to the user.
* Default value: "grid"
*/
view?: string;
}
/**
Data Grid UI Component that covers everything from paging, sorting, grouping, filtering, and editing to row and column virtualization, right-to-left layout, export to Excel and PDF and Accessibility.
*/
export interface Grid extends BaseElement, GridProperties {
/* Get a member by its name */
[name: string]: any;
/**
* This event is fired when a cell transitions into edit mode. Within the event handler, you can prevent the editing action for specific cells, rows, or columns by invoking <em>event.preventDefault()</em>. This allows you to control which cells are editable based on custom logic or application requirements.
* @param event. The custom event. Custom data event was created with: ev.detail(id, dataField, row, column, cell, data, value)
* id - The unique identifier of the edited row.
* dataField - The data field (column) associated with the edited cell.
* row - The edited row's full configuration object.
* column - The column configuration of the edited cell.
* cell - The edited cell object.
* data - The complete data record of the edited row.
* value - The current value of the edited cell.
*/
onBeginEdit?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Triggered when a user confirms a batch action by clicking the 'OK' button in a Grid header dropdown. Typical actions include column customization, applying sorting, or setting filters. This event signifies that the changes selected in the dropdown have been finalized and applied to the Grid.
* @param event. The custom event. Custom data event was created with: ev.detail(type)
* type - The type of dropdown where the batch change occurred. Possible values: 'filter', 'sort', 'search', 'group', 'format', 'customize'.
*/
onBatchChange?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Triggered when a user clicks the 'Cancel' button in the header dropdown of a Grid, thereby aborting an ongoing batch operation. This event allows you to handle cleanup or UI updates when a batch process is intentionally stopped before completion.
* @param event. The custom event. Custom data event was created with: ev.detail(type)
* type - The type of dropdown where the cancellation occurred. Possible values: 'filter', 'sort', 'search', 'group', 'format', 'customize'.
*/
onBatchCancel?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Fires whenever the selection within the Grid changes. During drag selection, this event is emitted both at the beginning of the drag operation and again when the selection is completed, allowing you to respond to both initiation and completion of drag-based selection changes.
* @param event. The custom event. Custom data event was created with: ev.detail(started, finished, originalEvent)
* started - Set to <em>true</em> when selection begins; <em>false</em> otherwise.
* finished - Set to <em>true</em> when selection ends; <em>false</em> otherwise.
* originalEvent - The native DOM event (pointer, touch, or mouse) that triggered the selection change.
*/
onChange: ((this: any, ev: Event) => any) | null;
/**
* Triggered when the user clicks on a column header in a table or grid, typically to initiate actions such as sorting, filtering, or displaying additional options related to that column. This event provides context about which column was interacted with, allowing developers to implement responsive behaviors based on user actions.
* @param event. The custom event. Custom data event was created with: ev.detail(column, dataField, originalEvent)
* column - The column configuration object of the clicked header.
* dataField - The data field associated with the clicked column.
* originalEvent - The native DOM event (pointer, touch, or mouse) that triggered the click.
*/
onColumnClick?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Fires when a user double-clicks on a column header, typically to initiate actions such as resizing, sorting, or customizing the corresponding column. The event provides information about the specific column that was interacted with, allowing you to implement custom logic in response to the double-click.
* @param event. The custom event. Custom data event was created with: ev.detail(column, dataField, originalEvent)
* column - The column configuration object of the double-clicked header.
* dataField - The data field associated with the double-clicked column.
* originalEvent - The native DOM event (pointer, touch, or mouse) that triggered the double-click.
*/
onColumnDoubleClick?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Triggered when the user adjusts the width of a column by dragging the boundary line in the column header. This event fires continuously as the header boundary is moved, allowing real-time updates to the column size.
* @param event. The custom event. Custom data event was created with: ev.detail(column, dataField, oldWidth, width)
* column - The resized column's configuration object.
* dataField - The data field associated with the resized column.
* oldWidth - The previous width of the column.
* width - The new width of the column after resizing.
*/
onColumnResize?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Fires when the user begins dragging a column to change its position within the column order. This event marks the start of a column reordering operation and can be used to implement visual feedback, custom logic, or to track changes in the column arrangement during a drag-and-drop interaction.
* @param event. The custom event. Custom data event was created with: ev.detail(column, dataField, index, originalEvent)
* column - The configuration object of the column being dragged.
* dataField - The data field associated with the column being dragged.
* index - The index of the column within the grid.
* originalEvent - The native DOM event that initiated the column drag.
*/
onColumnDragStart?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Triggered whenever a property of a column is modified, either through user interaction (such as editing in the UI) or by programmatic changes made via code. This event allows you to respond to any updates in column properties, regardless of how the change was initiated.
* @param event. The custom event. Custom data event was created with: ev.detail(column, propertyName, oldValue, value)
* column - The column whose property was changed.
* propertyName - The name of the property that was changed.
* oldValue - The previous value(s) of the changed property.
* value - The new value(s) of the changed property.
*/
onColumnChange?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* This event is fired repeatedly for as long as the user is actively dragging a column. It provides real-time updates during the entire drag operation, allowing you to implement responsive behaviors or visual feedback as the column is being repositioned.
* @param event. The custom event. Custom data event was created with: ev.detail(column, dataField, index, data, originalEvent)
* column - The column being dragged.
* dataField - The data field of the dragged column.
* index - The current index of the dragged column.
* data - An object providing drag feedback. Contains HTML elements 'feedback' and 'feedbackLine' shown during dragging, and methods 'error()', 'success()', and 'data()' for managing feedback state.
* originalEvent - The original browser event that triggered the dragging.
*/
onColumnDragging?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Triggered when the user releases the mouse button to drop a column after dragging it, indicating the end of a column drag-and-drop operation. This event can be used to update the column order or perform actions based on the new column arrangement.
* @param event. The custom event. Custom data event was created with: ev.detail(column, dataField, index, newIndex, data, originalEvent)
* column - The column that was dragged.
* dataField - The data field of the dragged column.
* index - The original index of the column before dragging.
* newIndex - The new index of the column after dragging.
* data - An object providing drag feedback. Contains HTML elements 'feedback' and 'feedbackLine' shown during dragging, and methods 'error()', 'success()', and 'data()' for managing feedback state.
* originalEvent - The original browser event that finalized the dragging.
*/
onColumnDragEnd?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Fires when the user changes the order of columns by dragging and repositioning a column within the interface. This event occurs after the column has been successfully moved to its new position.
* @param event. The custom event. Custom data event was created with: ev.detail(column, dataField, index, newIndex, data, originalEvent)
* column - The reordered column.
* dataField - The data field of the reordered column.
* index - The column's previous index before reorder.
* newIndex - The column's new index after reorder.
* data - An object providing drag feedback. Contains HTML elements 'feedback' and 'feedbackLine' shown during dragging, and methods 'error()', 'success()', and 'data()' for managing feedback state.
* originalEvent - The original browser event associated with the reorder.
*/
onColumnReorder?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Triggered when a user submits a new comment within the row edit dialog, typically as part of editing or updating a row's information. This event provides the context of the edited row and the content of the newly added comment, allowing for real-time updates or further processing.
* @param event. The custom event. Custom data event was created with: ev.detail(id, comment)
* id - The unique ID of the row where the comment was added.
* comment - The comment object containing: 'text' (string) - the comment text, 'id' (string) - unique comment ID, 'userId' (string | number) - ID of the user who added the comment, and 'time' (Date) - timestamp of the comment.
*/
onCommentAdd?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Triggered when a user deletes or removes a comment while editing a row using the row edit dialog. This event occurs after the comment has been removed from the input field within the dialog, allowing you to handle any additional logic, such as updating the UI, saving changes, or notifying other components.
* @param event. The custom event. Custom data event was created with: ev.detail(id, comment)
* id - The unique ID of the row from which the comment was removed.
* comment - The comment object containing: 'text' (string) - the comment text, 'id' (string) - unique comment ID, 'userId' (string | number) - ID of the user who added the comment, and 'time' (Date) - timestamp of the comment.
*/
onCommentRemove?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Occurs when a user selects (clicks) an item from the context menu, typically accessed via right-click or long-press. This event enables developers to handle specific actions in response to the user's menu item selection.
* @param event. The custom event. Custom data event was created with: ev.detail(id, dataField, command)
* id - The unique ID of the row associated with the context menu item.
* dataField - The data field of the clicked context menu item.
* command - The command object representing the action associated with the clicked menu item.
*/
onContextMenuItemClick?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Triggered when the user begins dragging a table row, typically by clicking and holding on the row before moving it. This event signals the start of a drag-and-drop operation for reordering or repositioning rows within the table.
* @param event. The custom event. Custom data event was created with: ev.detail(row, id, index, originalEvent)
* row - The row being dragged.
* id - The unique ID of the row being dragged.
* index - The index of the row within the grid.
* originalEvent - The original browser event that initiated the row drag.
*/
onRowDragStart?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* This event is triggered repeatedly in real-time as the user drags a row, firing continuously throughout the entire duration of the dragging action.
* @param event. The custom event. Custom data event was created with: ev.detail(row, id, index, data, originalEvent)
* row - The row currently being dragged.
* id - The unique ID of the dragged row.
* index - The index of the row being dragged.
* data - An object providing drag feedback. Contains HTML elements 'feedback' and 'feedbackLine' shown during dragging, and methods 'error()', 'success()', and 'data()' for managing feedback state.
* originalEvent - The original browser event that triggered the dragging.
*/
onRowDragging?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* This event is triggered upon completion of a row drag operation, regardless of whether the row’s position within the list was changed. It indicates the end of the drag interaction, and can be used to perform additional actions or cleanup tasks after users have finished dragging a row.
* @param event. The custom event. Custom data event was created with: ev.detail(row, id, index, newIndex, data, originalEvent)
* row - The dragged row object.
* id - The unique identifier of the dragged row.
* index - The original index of the row before dragging.
* newIndex - The new index of the row after dragging.
* data - The dragging feedback object containing HTML elements displayed during the drag operation. Includes `feedback` and `feedbackLine` elements, and methods `error()`, `success()`, and `data()` to set or retrieve the drag state and data.
* originalEvent - The original pointer, touch, or mouse event that triggered the drag.
*/
onRowDragEnd?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Triggered when a row has been successfully moved to a new position within the grid, indicating that the row reordering operation is complete and the grid's data order has been updated accordingly.
* @param event. The custom event. Custom data event was created with: ev.detail(row, id, index, newIndex, data, originalEvent)
* row - The reordered row object.
* id - The unique identifier of the reordered row.
* index - The original index of the row before reordering.
* newIndex - The new index of the row after reordering.
* data - The dragging feedback object containing HTML elements displayed during the reorder operation. Includes `feedback` and `feedbackLine` elements, and methods `error()`, `success()`, and `data()` to set or retrieve the drag state and data.
* originalEvent - The original pointer, touch, or mouse event that triggered the reorder.
*/
onRowReorder?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* This event is triggered when a user expands a row in either TreeGrid or Grouping mode, causing the hidden child rows or grouped data associated with that row to be displayed. It allows you to respond when hierarchical data or grouped content is revealed within the grid.
* @param event. The custom event. Custom data event was created with: ev.detail(row, id, originalEvent)
* row - The expanded row object.
* id - The unique identifier of the expanded row.
* originalEvent - The original pointer, touch, or mouse event that caused the expansion.
*/
onRowExpand?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Triggered when a row is collapsed in TreeGrid or Grouping mode, causing any nested child rows or grouped content under that row to be hidden from view. This event allows you to respond when users collapse a parent row, such as updating UI elements or loading data dynamically.
* @param event. The custom event. Custom data event was created with: ev.detail(row, id, originalEvent)
* row - The collapsed row object.
* id - The unique identifier of the collapsed row.
* originalEvent - The original pointer, touch, or mouse event that caused the collapse.
*/
onRowCollapse?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Triggered when a user clicks anywhere within a table row, allowing you to respond to row selection events, such as highlighting the row, displaying detailed information, or performing related actions.
* @param event. The custom event. Custom data event was created with: ev.detail(row, originalEvent, id, data, isRightClick, pageX, pageY)
* row - The clicked row object.
* originalEvent - The original pointer, touch, or mouse event for the click.
* id - The unique identifier of the clicked row.
* data - The data object associated with the clicked row.
* isRightClick - Indicates whether the right mouse button was used for the click.
* pageX - The X-coordinate of the click relative to the page.
* pageY - The Y-coordinate of the click relative to the page.
*/
onRowClick?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* This event is triggered when a user rapidly double-clicks on any row within the data grid or table. It can be used to initiate actions such as opening a detailed view, activating edit mode, or performing custom operations related to the selected row. The event handler receives contextual information about the clicked row, allowing for targeted interactions.
* @param event. The custom event. Custom data event was created with: ev.detail(row, originalEvent, id, data, isRightClick, pageX, pageY)
* row - The double-clicked row object.
* originalEvent - The original pointer, touch, or mouse event for the double-click.
* id - The unique identifier of the double-clicked row.
* data - The data object associated with the double-clicked row.
* isRightClick - Indicates whether the right mouse button was used for the double-click.
* pageX - The X-coordinate of the double-click relative to the page.
* pageY - The Y-coordinate of the double-click relative to the page.
*/
onRowDoubleClick?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Triggered when the user manually adjusts the height of a table row, such as by dragging the row's resize handle. This event allows you to respond to row height changes, for example, by updating layout or saving the new row height.
* @param event. The custom event. Custom data event was created with: ev.detail(row, id, oldHeight, height)
* row - The resized row object.
* id - The unique identifier of the resized row.
* oldHeight - The height of the row before resizing.
* height - The new height of the row after resizing.
*/
onRowResize?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Triggered when the user clicks the star icon located in a row header, toggling the starred (favorite) status of the corresponding row. This event allows you to handle actions such as marking or unmarking the row as a favorite in response to user interaction.
* @param event. The custom event. Custom data event was created with: ev.detail(row, originalEvent, id, value)
* row - The row associated with the star toggle.
* originalEvent - The original pointer, touch, or mouse event for the star click.
* id - The unique identifier of the starred row.
* value - Boolean indicating whether the row is now starred (`true`) or unstarred (`false`).
*/
onRowStarred?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
/**
* Fires when a user clicks on any individual cell within the grid, providing information about the selected cell’s row, column, and associated data. This event enables you to implement