UNPKG

@eclipse-scout/core

Version:
1,059 lines 65.7 kB
/// <reference types="jquery" /> import { AbstractTableAccessibilityRenderer, Action, Alignment, BooleanColumn, Cell, CellEditorPopup, Column, CompactColumn, Comparator, ContextMenuPopup, Desktop, DesktopPopupOpenEvent, DisplayViewId, DoubleClickSupport, DragAndDropHandler, DropType, EnumObject, EventHandler, Filter, Filterable, FilterOrFunction, FilterResult, FilterSupport, IconColumn, InitModelOf, Insets, IUserFilterStateDo, KeyStrokeContext, LoadingSupport, Menu, MenuBar, MenuDestinations, NumberColumn, NumberColumnAggregationFunction, NumberColumnBackgroundEffect, ObjectOrChildModel, ObjectOrModel, Predicate, PropertyChangeEvent, Range, ScrollToOptions, Status, StatusOrModel, TableClientUiPreferenceProfileDo, TableCompactHandler, TableControl, TableCustomizer, TableEventMap, TableFooter, TableHeader, TableModel, TableOrganizer, TableRow, TableRowModel, TableSelectionHandler, TableTileGridMediator, TableTooltip, TableUpdateBuffer, TableUserFilter, TableUserFilterModel, Tile, TileTableHeaderBox, UpdateFilteredElementsOptions, ValueField, Widget } from '../index'; export declare class Table extends Widget implements TableModel, Filterable<TableRow> { model: TableModel; eventMap: TableEventMap; self: Table; columnMap: ColumnMap; autoResizeColumns: boolean; columnAddable: boolean; columnLayoutDirty: boolean; columns: Column<any>[]; contextColumn: Column<any>; checkable: boolean; displayViewId: DisplayViewId; checkableStyle: TableCheckableStyle; cellEditorPopup: CellEditorPopup<any>; compact: boolean; openFieldPopupOnCellEdit: boolean; compactHandler: TableCompactHandler; compactColumn: CompactColumn; dropType: DropType; dropMaximumSize: number; dragAndDropHandler: DragAndDropHandler; groupingStyle: TableGroupingStyle; header: TableHeader; tableStatus: Status; rowBorders: Insets; headerEnabled: boolean; headerVisible: boolean; headerMenusEnabled: boolean; hasReloadHandler: boolean; /** * Defines whether hierarchical mode is active, meaning the table is grouping rows with the same {@link TableRow.parentRow} and allowing the user to expand and collapse these groups. * * The property returns true if there is at least one row with a parent row, false otherwise. */ hierarchical: boolean; hierarchicalStyle: TableHierarchicalStyle; keyStrokes: Action[]; menus: Menu[]; menuBar: MenuBar; menuBarVisible: boolean; contextMenu: ContextMenuPopup; multiCheck: boolean; multiSelect: boolean; multilineText: boolean; scrollToSelection: boolean; selectedRows: TableRow[]; sortEnabled: boolean; tableControls: TableControl[]; tableStatusVisible: boolean; tableTileGridMediator: TableTileGridMediator; tileMode: boolean; tileTableHeader: TileTableHeaderBox; tileProducer: (row: TableRow) => Tile; footer: TableFooter; footerVisible: boolean; filters: Filter<TableRow>[]; /** * Contains all rows of the table. */ rows: TableRow[]; /** * Contains only the root rows of the table. * If the table is not {@link hierarchical}, it is the same as {@link rows}. */ rootRows: TableRow[]; /** * Contains only the rows that are expanded and accepted by all filters. */ visibleRows: TableRow[]; estimatedRowCount: number; maxRowCount: number; aggregateRowHeight: number; truncatedCellTooltipEnabled: boolean; checkableColumn: BooleanColumn; rowIconColumn: IconColumn; uiCssClass: string; /** visible rows by id */ visibleRowsMap: Record<string, TableRow>; rowLevelPadding: number; /** rows by id */ rowsMap: Record<string, TableRow>; rowHeight: number; rowWidth: number; /** read-only, set by _calculateRowInsets(), also used in TableHeader.js */ rowInsets: Insets; /** read-only, set by _calculateRowInsets(), also used in TableLayout.js */ rowMargins: Insets; rowIconVisible: boolean; rowIconColumnWidth: number; staticMenus: Menu[]; selectionHandler: TableSelectionHandler; tooltips: TableTooltip[]; tableNodeColumn: Column<any>; updateBuffer: TableUpdateBuffer; /** * Initial value must be > 0 to make prefSize work (if it is 0, no filler will be generated). * If rows have a variable height, prefSize is only correct for 10 rows. * Layout will adjust this value depending on the view port size. */ viewRangeSize: number; viewRangeDirty: boolean; viewRangeRendered: Range; virtual: boolean; textFilterEnabled: boolean; filterSupport: FilterSupport<TableRow>; filteredElementsDirty: boolean; defaultMenuTypes: string[]; accessibilityRenderer: AbstractTableAccessibilityRenderer; organizer: TableOrganizer; customizer: TableCustomizer; defaultRowAction: Action; userPreferenceContext: string; uiPreferencesEnabled: boolean; $data: JQuery; $emptyData: JQuery; $fillBefore: JQuery; $fillAfter: JQuery; /** @internal */ _renderViewportBlocked: boolean; /** @internal */ _filterMenusHandler: (menuItems: Menu[], destination: MenuDestinations) => Menu[]; /** @internal */ _aggregateRows: AggregateTableRow[]; protected _filteredRows: TableRow[]; protected _maxLevel: number; protected _animationRowLimit: number; protected _blockLoadThreshold: number; protected _doubleClickSupport: DoubleClickSupport; protected _permanentHeadSortColumns: Column<any>[]; protected _permanentTailSortColumns: Column<any>[]; protected _popupOpenHandler: EventHandler<DesktopPopupOpenEvent>; protected _rerenderViewPortAfterAttach: boolean; protected _renderViewPortAfterAttach: boolean; protected _triggerRowsSelectedPending: boolean; protected _animateAggregateRows: boolean; protected _postAttachActions: (() => void)[]; protected _desktopPropertyChangeHandler: EventHandler<PropertyChangeEvent<any, Desktop>>; protected _menuInheritAccessibilityChangeHandler: EventHandler<PropertyChangeEvent<boolean, Menu>>; protected _imageLoadListener: (event: ErrorEvent) => void; protected _insertedRows: TableRow[]; protected _$mouseDownRow: JQuery; protected _mouseDownRowId: string; protected _mouseDownColumn: Column<any>; protected _initialUiPreferences: TableClientUiPreferenceProfileDo; constructor(); static MenuType: { /** * The menu is always visible and displayed first in the {@link MenuBar}. * The menu won't be displayed in the context menu. */ readonly EmptySpace: "Table.EmptySpace"; /** * The menu is only visible if exactly one row has been selected. * The menu is also displayed in the context menu. */ readonly SingleSelection: "Table.SingleSelection"; /** * The menu is only visible if at least two row have been selected. * The menu is also displayed in the context menu. */ readonly MultiSelection: "Table.MultiSelection"; /** * The menu is displayed in the {@link TableHeader} on the right side. */ readonly Header: "Table.Header"; }; static HierarchicalStyle: { readonly DEFAULT: "default"; readonly STRUCTURED: "structured"; }; static GroupingStyle: { /** * Aggregate row is rendered on top of the row-group. */ readonly TOP: "top"; /** * Aggregate row is rendered on the bottom of the row-group (default). */ readonly BOTTOM: "bottom"; }; static CheckableStyle: { /** * When row is checked a boolean column with a checkbox is inserted into the table. */ readonly CHECKBOX: "checkbox"; /** * When a row is checked the table-row is marked as checked. By default, a background * color is set on the table-row when the row is checked. */ readonly TABLE_ROW: "tableRow"; /** * Like the CHECKBOX Style but a click anywhere on the row triggers the check. */ readonly CHECKBOX_TABLE_ROW: "checkbox_table_row"; }; /** * This enum defines the reload-reasons for a table reload operation */ static ReloadReason: { /** * No specific reason, just reload data using the current search settings, the current row limits and the current * filter (Default) */ readonly UNSPECIFIED: "unspecified"; /** * Some search parameters changed or the search was reset and the search was triggered */ readonly SEARCH: "search"; /** * The user requested loading more data than his soft limit, up to the application specific hard limit */ readonly OVERRIDE_ROW_LIMIT: "overrideRowLimit"; /** * The user requested loading no more data than his soft limit; */ readonly RESET_ROW_LIMIT: "resetRowLimit"; /** * The column structure of the table was changed */ readonly ORGANIZE_COLUMNS: "organizeColumns"; /** * Any call to IPage#dataChanged */ readonly DATA_CHANGED_TRIGGER: "dataChangedTrigger"; }; static SELECTION_CLASSES: string; protected _init(model: InitModelOf<this>): void; protected _initTablePreferences(): void; protected _initRow(row: ObjectOrModel<TableRow>): TableRow; protected _createRow(rowModel?: TableRowModel): TableRow; protected _initColumns(): void; /** * Calculates the {@link Table.checkableColumn} (see {@link Table._calculateCheckableColumn}), the {@link Table.tableNodeColumn} (see {@link Table._calculateTableNodeColumn}) * and the {@link Table._permanentHeadSortColumns} and {@link Table._permanentTailSortColumns} (see {@link Table._setHeadAndTailSortColumns}). */ protected _calculateCheckableTableNodeAndSortColumns(): void; protected _destroy(): void; protected _destroyColumns(): void; protected _calculateTableNodeColumn(): void; protected _createLoadingSupport(): LoadingSupport; protected _createKeyStrokeContext(): KeyStrokeContext; protected _initKeyStrokeContext(): void; protected _initTableKeyStrokeContext(): void; protected _insertBooleanColumn(): void; protected _insertRowIconColumn(): void; handleAppLinkAction(event: JQuery.KeyboardEventBase): void; /** @internal */ _isDataRendered(): boolean; protected _render(): void; /** @internal */ _renderData(): void; protected _renderProperties(): void; protected _setCssClass(cssClass: string): void; /** @internal */ _removeData(): void; protected _remove(): void; setRowLevelPadding(rowLevelPadding: number): void; protected _renderRowLevelPadding(): void; setTableControls(controls: ObjectOrChildModel<TableControl>[]): void; protected _renderTableControls(): void; protected _setTableControls(controls: TableControl[]): void; /** * When an IMG has been loaded we must update the stored height in the model-row. * Note: we don't change the width of the row or table. */ protected _onImageLoadOrError(event: ErrorEvent): void; protected _onRowMouseDown(event: JQuery.MouseDownEvent): void; protected _isRowControl($target: JQuery): boolean; protected _onRowMouseUp(event: JQuery.MouseUpEvent): void; protected _onRowDoubleClick(event: JQuery.DoubleClickEvent): void; showContextMenu(options: { pageX?: number; pageY?: number; }): void; protected _showContextMenu(options: { pageX?: number; pageY?: number; }): void; isRowSelectedAndVisible(row: TableRow): boolean; getLastSelectedAndVisibleRow(): TableRow; onColumnVisibilityChanged(): void; protected _onScroll(event: JQuery.ScrollEvent): void; protected _renderTableStatus(): void; setContextColumn(contextColumn: Column<any>): void; protected _hasVisibleTableControls(): boolean; hasAggregateTableControl(): boolean; findTableControl<T extends TableControl>(type: new () => T, predicate?: (tableControl: T) => boolean): T; protected _createHeader(): TableHeader; protected _createFooter(): TableFooter; protected _initOrganizer(autoCreate?: boolean): void; protected _createOrganizer(): TableOrganizer; protected _destroyOrganizer(): void; setOrganizer(organizer: TableOrganizer): void; protected _setOrganizer(organizer: TableOrganizer): void; protected _initCustomizer(): void; protected _destroyCustomizer(): void; setCustomizer(customizer: TableCustomizer): void; protected _setCustomizer(customizer: TableCustomizer): void; setDefaultRowAction(defaultRowAction: Action | string): void; protected _setDefaultRowAction(defaultRowAction: Action): void; protected _installCellTooltipSupport(): void; protected _uninstallCellTooltipSupport(): void; /** @internal */ _cellTooltipText($cell: JQuery): string; /** @see TableModel.truncatedCellTooltipEnabled */ setTruncatedCellTooltipEnabled(truncatedCellTooltipEnabled: boolean): void; /** * Decides if a cell tooltip should be shown for a truncated cell. */ protected _isTruncatedCellTooltipEnabled(column: Column<any>): boolean; protected _isAggregatedTooltip($cell: JQuery): boolean; protected _isCellTooltipHtmlEnabled($cell: JQuery): boolean; reload(reloadReason?: TableReloadReason): void; setLoading(loading: boolean): void; exportToClipboard(): void; /** * JS implementation of AbstractTable.execCopy(rows) */ protected _exportToClipboard(): void; protected _selectedRowsToText(): string; protected _unwrapText(text?: string): string; /** @see TableModel.multiSelect */ setMultiSelect(multiSelect: boolean): void; toggleSelection(): void; selectAll(): void; deselectAll(): void; checkAll(checked?: boolean, options?: TableRowCheckOptions): void; uncheckAll(options?: TableRowCheckOptions): void; updateScrollbars(): void; protected _sort(animateAggregateRows?: boolean): boolean; /** * @returns whether or not sorting is possible. Asks each column to answer this question by calling Column#isSortingPossible. */ protected _isSortingPossible(sortColumns: Column<any>[]): boolean; protected _sortColumns(): Column<any>[]; protected _sortImpl(sortColumns: Column<any>[]): void; /** * Pre-order (top-down) traversal of all rows in this table (if hierarchical). */ visitRows(visitFunc: (row: TableRow, level: number) => void, rows?: TableRow[], level?: number): void; protected _sortHierarchical(sortFunc: Comparator<TableRow>, rows?: TableRow[]): void; protected _renderRowOrderChanges(): void; /** @see TableModel.sortEnabled */ setSortEnabled(sortEnabled: boolean): void; /** * Adds the column to the list of sorted columns and re-sorts the table rows. * * @param direction the sorting direction. Either 'asc' or 'desc'. If not specified, the direction specified by the column is used ({@link Column.sortAscending}). */ addSortColumn(column: Column<any>, direction?: 'asc' | 'desc'): void; /** * Removes the column from the list of sorted columns and re-sorts the table rows. */ removeSortColumn(column: Column<any>): void; /** * Clears the list of sorted columns and re-sort the table rows. */ removeAllSortColumns(): void; /** * The number of visible columns that are sorted. */ visibleSortColumnsCount(): number; /** * @param column * the column to sort by. * @param direction * the sorting direction. Either 'asc' or 'desc'. * If not specified, the direction specified by the column is used ({@link Column.sortAscending}). * @param multiGroup * true to add the column to the list of sorted columns. * False to use this column exclusively as sort column (reset other columns). * Does not have an effect is `remove` is set to true. * Default is false. * @param remove * true to remove the column from the list of sorted columns. * Default is false. */ sort(column: Column<any>, direction?: 'asc' | 'desc', multiSort?: boolean, remove?: boolean): void; protected _addSortColumn(column: Column<any>, direction?: 'asc' | 'desc', multiSort?: boolean): void; /** * Intended to be called for new sort columns. * Sets the sortIndex of the given column and its siblings. */ protected _updateSortIndexForColumn(column: Column<any>, multiSort: boolean): void; protected _removeSortColumn(column: Column<any>): void; protected _removeSortColumnInternal(column: Column<any>): void; isGroupingPossible(column: Column<any>): boolean; isAggregationPossible(column: Column<any>): boolean; changeAggregation(column: NumberColumn, func: NumberColumnAggregationFunction): void; changeAggregations(columns: NumberColumn[], functions: NumberColumnAggregationFunction[]): void; protected _addGroupColumn(column: Column<any>, direction?: 'asc' | 'desc', multiGroup?: boolean): void; protected _removeGroupColumn(column: Column<any>): void; protected _buildRowDiv(row: TableRow): string; protected _calculateRowInsets(): void; /** @internal */ _updateRowWidth(): void; /** * A html element with display: table-cell gets the wrong width in Chrome when zoom is enabled, see * https://bugs.chromium.org/p/chromium/issues/detail?id=740502. * Because the table header items don't use display: table-cell, theirs width is correct. * -> Header items and table cells are not in sync which is normally not a big deal but gets visible very well with a lot of columns. * This method reads the real width and stores it on the column so that the header can use it when setting the header item's size. * It is also necessary to update the row width accordingly otherwise it would be cut at the very right. * @internal */ _updateRealColumnWidths($row?: JQuery): boolean; protected _updateRealColumnWidth(column: Column<any>, colIndex?: number, $row?: JQuery): boolean; protected _updateRowHeight(): void; /** * Updates the row heights for every visible row and aggregate row and clears the height of the others */ protected _updateRowHeights(): void; protected _renderRowsInRange(range: Range): void; protected _rowsRenderedInfo(): string; /** * Moves the row to the top. * * @returns true, if the row has been moved, false if not. */ moveRowToTop(row: TableRow): boolean; /** * Moves the row to the bottom. * * @returns true, if the row has been moved, false if not. */ moveRowToBottom(row: TableRow): boolean; /** * Moves the row one up. * * @returns true, if the row has been moved, false if not. */ moveRowUp(row: TableRow): boolean; /** * Moves the row one down. * * @returns true, if the row has been moved, false if not. */ moveRowDown(row: TableRow): boolean; /** * Moves the row one up, considering only the {@link visibleRows}. * * @returns true, if the row has been moved, false if not. */ moveVisibleRowUp(row: TableRow): boolean; /** * Moves the row one down, considering only the {@link visibleRows}. * * @returns true, if the row has been moved, false if not. */ moveVisibleRowDown(row: TableRow): boolean; /** * Moves the given rows one up or one down, depending on the direction. * * @returns the moved table rows or an empty array if no rows have been moved. */ moveRowsUpOrDown(rows: TableRow[], direction: TableRowMoveDirection): TableRow[]; /** * Moves the row one up or one down, depending on the direction. * * @returns true, if the row has been moved, false if not. */ moveRowUpOrDown(row: TableRow, direction: TableRowMoveDirection): boolean; /** * Moves the row one up or one down, depending on the direction, considering only the {@link visibleRows}. * * @returns true, if the row has been moved, false if not. */ moveVisibleRowUpOrDown(row: TableRow, direction: TableRowMoveDirection): boolean; protected _findSiblingWithSameParent(row: TableRow, direction: TableRowMoveDirection, rows?: TableRow[]): TableRow; /** * Moves the row from the source index to the target index. * * @returns true, if the row has been moved, false if not. */ moveRow(sourceIndex: number, targetIndex: number): boolean; protected _removeRowsInRange(range: Range): void; /** * @deprecated use {@link _removeAllRows} to only remove DOM elements, otherwise use {@link deleteAllRows} */ removeAllRows(): void; protected _removeAllRows(): void; /** * * @param rows if undefined, all rows are removed */ protected _removeRows(rows?: TableRow | TableRow[]): void; /** * Just removes the row, does NOT adjust this.viewRangeRendered */ protected _removeRow(row: TableRow | AggregateTableRow): void; /** * Animates the rendering of a row by setting it to invisible before doing a slideDown animation. The row needs to already be rendered. */ protected _showRow(row: TableRow | AggregateTableRow): void; /** * Animates the removal of a row by doing a slideUp animation. The row will be removed after the animation finishes. */ protected _hideRow(row: TableRow | AggregateTableRow): void; /** * This method should be used after a row is added to the DOM (new rows, updated rows). The 'row' * is expected to be linked with the corresponding '$row' (row.$row and $row.data('row')). */ protected _installRow(row: TableRow): void; /** @internal */ _calcRowLevelPadding(row: { parentRow?: TableRow; }): number; protected _showCellErrorForRow(row: TableRow): void; protected _showCellError(row: TableRow, $cell: JQuery, errorStatus: Status): void; /** * @returns the column at position x (e.g. from event.pageX) */ protected _columnAtX(x: number): Column<any>; protected _find$AppLink(event: JQuery.MouseUpEvent): JQuery; /** @internal */ _filterMenus(menuItems: Menu[], destination: MenuDestinations, onlyVisible?: boolean, enableDisableKeyStrokes?: boolean, notAllowedTypes?: string | string[]): Menu[]; /** @internal */ _filterMenusForContextMenu(): Menu[]; setStaticMenus(staticMenus: ObjectOrChildModel<Menu>[]): void; protected _removeMenus(): void; notifyRowSelectionFinished(): void; /** @internal */ _triggerRowClick(originalEvent: JQuery.MouseEventBase, row: TableRow, mouseButton: number, column?: Column<any>): void; /** * Starts cell editing for the cell at the given column and row, but only if editing is allowed. * @see prepareCellEdit */ focusCell(column: Column<any>, row: TableRow, openFieldPopupOnCellEdit?: boolean): void; /** * Creates a cell editor for the cell at the given column and row, ensures the row is selected and passes the editor * to {@link #startCellEdit} which starts the editing by rendering the editor in a {@link CellEditorPopup}.<br> * If the completion of a previous cell edit is still in progress, the preparation is delayed until the completion is finished. * * @param openFieldPopupOnCellEdit true to instruct the editor to open its control popup when the editor is rendered. * This only has an effect if the editor has a popup (e.g. SmartField or DateField). * @returns The promise will be resolved when the preparation has been finished. */ prepareCellEdit(column: Column<any>, row: TableRow, openFieldPopupOnCellEdit?: boolean): JQuery.Promise<void>; /** * @param openFieldPopupOnCellEdit when this parameter is set to true, the field instance may use this property (passed to onCellEditorRendered of the field) * to decide whether it should open a popup immediately after it is rendered. This is used for Smart- and DateFields. Default is false. */ prepareCellEditInternal(column: Column<any>, row: TableRow, openFieldPopupOnCellEdit?: boolean): void; /** * @returns a cell for the given column and row or null if column or row is null or undefined. * Because the artificial {@link rowIconColumn} and {@link checkableColumn} don't have cells, a dummy cell will be created for these columns. */ cell<TValue>(column: Column<TValue>, row: TableRow): Cell<TValue>; cellByCellIndex(cellIndex: number, row: TableRow): Cell; /** * @returns the value of the cell for the given column and row. */ cellValue<TValue>(column: Column<TValue>, row: TableRow): TValue; cellText(column: Column<any>, row: TableRow): string; /** * * @returns the next editable position in the table, starting from the cell at (currentColumn / currentRow). * A position is an object containing row and column (cell has no reference to a row or column due to memory reasons). */ nextEditableCellPos(currentColumn: Column<any>, currentRow: TableRow, reverse: boolean): TableCellPosition; nextEditableCellPosForRow(startColumnIndex: number, row: TableRow, reverse?: boolean): TableCellPosition; clearAggregateRows(animate?: boolean): void; /** * @internal * Executes the aggregate function with the given funcName for each visible column, but only if the Column * has that function, which is currently only the case for NumberColumns. * * @param states is a reference to an Array containing the results for each visible column * @param row (optional) if set, an additional cell-value parameter is passed to the aggregate function */ _forEachVisibleColumn(funcName: string, states: object[], row?: TableRow): void; /** @internal */ _group(animate?: boolean): void; protected _isNewGroup(groupedColumns: Column<any>[], row: TableRow, nextRow: TableRow): boolean; protected _groupedColumns(): Column<any>[]; /** * Inserts a new aggregation row between 'prevRow' and 'nextRow'. * * @param contents cells of the new aggregate row * @param prevRow row _before_ the new aggregate row * @param nextRow row _after_ the new aggregate row */ protected _addAggregateRow(contents: any[], prevRow: TableRow, nextRow: TableRow): void; protected _removeAggregateRows(animate?: boolean): void; protected _renderAggregateRows(animate?: boolean): void; /** @internal */ _build$AggregateRow(aggregateRow?: AggregateTableRow): JQuery; /** * Adds the column to the list of grouped columns and re-sorts the table rows. * * @param direction * the sorting direction. Either 'asc' or 'desc'. * If not specified, the direction specified by the column is used ({@link Column.sortAscending}). */ addGroupColumn(column: Column<any>, direction?: 'asc' | 'desc'): void; /** * Removes the column from the list of grouped columns and re-sorts the table rows. */ removeGroupColumn(column: Column<any>): void; /** * Clears the list of grouped columns and re-sort the table rows. */ removeAllGroupColumns(): void; /** * The number of visible columns that are grouped. */ visibleGroupColumnsCount(): number; /** * @deprecated use {@link group} instead. */ groupColumn(column: Column<any>, multiGroup?: boolean, direction?: 'asc' | 'desc', remove?: boolean): void; /** * @param column * the column to group by. * @param direction * the sorting direction. Either 'asc' or 'desc'. * If not specified, the direction specified by the column is used ({@link Column.sortAscending}). * @param multiGroup * true to add the column to the list of grouped columns. * False to use this column exclusively as group column (reset other columns). * Does not have an effect is `remove` is set to true. * Default is false. * @param remove * true to remove the column from the list of grouped columns. * Default is false. */ group(column: Column<any>, direction?: 'asc' | 'desc', multiGroup?: boolean, remove?: boolean): void; /** * @deprecated use removeGroupColumn */ removeColumnGrouping(column: Column<any>): void; /** * @deprecated use removeGroupColumn */ removeAllColumnGroupings(): void; /** * @returns true if at least one column is {@link Column.grouped}. */ isGrouped(): boolean; setColumnBackgroundEffect(column: NumberColumn, effect: NumberColumnBackgroundEffect): void; /** * Updates the background effect of every column, if column.backgroundEffect is set. * Meaning: Recalculates the min / max values and renders the background effect again. */ protected _updateBackgroundEffect(): void; /** * Recalculates the values necessary for the background effect of every column, if column.backgroundEffect is set */ protected _calculateValuesForBackgroundEffect(): void; protected _markAutoOptimizeWidthColumnsAsDirty(): void; protected _markAutoOptimizeWidthColumnsAsDirtyIfNeeded(autoOptimizeWidthColumns: Column<any>[], oldRow: TableRow, newRow: TableRow): boolean; /** @see TableModel.multiCheck */ setMultiCheck(multiCheck: boolean): void; /** * @returns the first row that is checked. */ checkedRow(): TableRow; /** * @returns all rows that are checked. The returned rows have the same order as {@link rows}. */ checkedRows(): TableRow[]; /** * Checks the given row if `checked` is set to true (which is the default) or unchecks it otherwise. * * @see checkRows */ checkRow(row: TableRow, checked?: boolean, options?: TableRowCheckOptions): void; /** * Checks the given rows if `options.checked` is set to true (which is the default) or unchecks them otherwise. * Does not modify any other rows unless {@link multiCheck} is set to false. In that case, other rows may get unchecked. * * The checked state will only be modified if the table is {@link checkable} and the row and table are enabled. * If `options.checkOnlyEnabled` is set to false, the rows can be checked even if the row or table is disabled. */ checkRows(rows: TableRow | TableRow[], options?: TableRowCheckOptions): void; /** * Unchecks the given row. * * @see checkRows */ uncheckRow(row: TableRow, options?: TableRowCheckOptions): void; /** * Unchecks the given rows. * * @see checkRows */ uncheckRows(rows: TableRow | TableRow[], options?: TableRowCheckOptions): void; isTableNodeColumn(column: Column<any>): boolean; collapseRow(row: TableRow): void; collapseAll(): void; expandAll(): void; collapseRows(rows: TableRow[], recursive?: boolean): void; expandRow(row: TableRow, recursive?: boolean): void; expandRows(rows: TableRow[], recursive?: boolean): void; /** * @param rows {@link rootRows} are used if not specified. * @param expanded Default is true. * @param recursive Default is false. */ expandRowsInternal(rows?: TableRow[], expanded?: boolean, recursive?: boolean): void; doRowAction(row: TableRow, column?: Column<any>): void; /** * Inserts the given row at the end of the existing {@link rows}. * * @see insertRows */ insertRow(row: ObjectOrModel<TableRow>): void; /** * Inserts the given rows at the end of the existing {@link rows}. * * @example Compact approach to insert rows using {@link TableRowModel} * // Create an array of model rows. * // The cells can consist of the values or real cell objects that need to match the order of the columns. * let rows = [{ * cells: ['value row 0 column 0', 'value row 0 column 1'] * }, { * cells: ['value row 1 column 0', scout.create(Cell, {value: 'value row 1 column 1', tooltipText: 'tooltip for this cell'})] * }]; * table.insertRows(rows); * * @example Type-safe approach to insert rows using {@link Column}. * // Create an array of actual table rows. The values or cell properties can be set using the appropriate column. * // This approach is more type-safe and does not rely on the order of the columns. * let row0 = scout.create(TableRow, {parent: table}); * table.columnById('FirstColumn').setCellValue(row0, 'value row 0 column 0'); * table.columnById('SecondColumn').setCellValue(row0, 'value row 0 column 1'); * * let row1 = scout.create(TableRow, {parent: table}); * table.columnById('FirstColumn').setCellValue(row1, 'value row 1 column 0'); * table.columnById('SecondColumn').setCellValue(row1, 'value row 1 column 1'); * table.columnById('SecondColumn').cell(row1).setTooltipText('tooltip for this cell'); * table.insertRows([row0, row1]); * * @param rows the new rows to be inserted. */ insertRows(rows: ObjectOrModel<TableRow> | ObjectOrModel<TableRow>[]): void; protected _sortAfterInsert(wasEmpty: boolean): void; protected _sortWhileInit(): void; /** * Replaces all current rows by the given ones and tries to restore the selection afterward (see {@link restoreSelection}). */ replaceRows(rows: ObjectOrModel<TableRow> | ObjectOrModel<TableRow>[]): void; protected _restoreScrollTop(scrollTop: number): void; deleteRow(row: TableRow): void; deleteRows(rows: TableRow | TableRow[]): void; deleteAllRows(): void; updateRow(row: ObjectOrModel<TableRow>): void; updateRows(rows: ObjectOrModel<TableRow> | ObjectOrModel<TableRow>[]): void; protected _renderUpdateRows(rows: TableRow[], oldRowsMap: Record<string, TableRow>): void; protected _sortAfterUpdate(): void; /** * @deprecated use {@link hierarchical} instead */ isHierarchical(): boolean; protected _setHierarchical(hierarchical: boolean): void; /** * The given rows must be rows of this table in desired order. */ updateRowOrder(rows: TableRow | TableRow[]): void; protected _destroyTooltipsForRow(row: TableRow | AggregateTableRow): void; protected _destroyCellEditorForRow(row: TableRow | AggregateTableRow): void; startCellEdit<TValue>(column: Column<TValue>, row: TableRow, field: ValueField<TValue>): CellEditorPopup<TValue>; /** * @param saveEditorValue when this parameter is set to true, the value of the editor field is set as * new value on the edited cell. In remote case this parameter is always false, because the cell * value is updated by an updateRow event instead. Default is false. */ endCellEdit(field: ValueField<any>, saveEditorValue?: boolean): void; protected _updateCellFromEditor<TValue>(cellEditorPopup: CellEditorPopup<TValue>, field: ValueField<TValue>, saveEditorValue?: boolean): void; /** * Completes the cell editing with the following steps: * - Triggers the `completeCellEdit` event. If `preventDefault()` is called on the event, the following steps are not executed. * - Updates the cell value with the value from the cell editor. * - Closes the cell editor. */ completeCellEdit(): void; /** * Cancels the cell editing with the following steps: * - Triggers the `cancelCellEdit` event. If `preventDefault()` is called on the event, the following step is not executed. * - Closes the cell editor without updating the cell's value. */ cancelCellEdit(): void; scrollTo(row: TableRow, options?: ScrollToOptions | string): void; scrollPageUp(): void; scrollPageDown(): void; setScrollTop(scrollTop: number): void; /** @internal */ _renderScrollTop(): void; get$Scrollable(): JQuery; /** @see TableModel.scrollToSelection */ setScrollToSelection(scrollToSelection: boolean): void; revealSelection(): void; revealChecked(): void; rowById(id: string): TableRow; rowsByIds(ids: string[]): TableRow[]; rowsToIds(rows: TableRow[]): string[]; /** * Checks whether the given row is contained in the table. Uses the id of the row for the lookup. */ hasRow(row: ObjectOrModel<TableRow>): boolean; /** * render borders and selection of row. default select if no argument or false is passed in deselect * model has to be updated before calling this method. */ protected _renderSelection(rows?: TableRow | TableRow[]): void; /** @internal */ _removeSelection(): void; protected _renderNoRowsSelectedMarker(): void; addRowToSelection(row: TableRow, ongoingSelection?: boolean): void; removeRowFromSelection(row: TableRow, ongoingSelection?: boolean): void; selectRow(row: TableRow, debounceSend?: boolean): void; selectRows(rows: TableRow | TableRow[], debounceSend?: boolean): void; deselectRow(row: TableRow): void; deselectRows(rows: TableRow | TableRow[]): void; isRowSelected(row: TableRow): boolean; /** * Restores the selection by the given selectedKeys. Rows matching these given values (see {@link getRowsByKey}) will be selected. * If the table is {@link hierarchical} all parent rows of selected rows will be expanded. * * @param selectedKeys array of key values (see {@link TableRow.getKeyValues}) of the rows to select. */ restoreSelection(selectedKeys: any[][]): void; /** * If the table is hierarchical, ensures that for the given rows all parent rows up to the root are expanded. * If the table is not hierarchical or no rows are given, nothing happens. */ expandParentRows(rows: TableRow[]): void; /** * Get the key values (see {@link TableRow.getKeyValues}) of all selected rows. */ getSelectedKeys(): any[][]; /** * Get rows by comparing the given keys with the key values (see {@link TableRow.getKeyValues}) of the current rows. * * @param keys array of key values (see {@link TableRow.getKeyValues}). */ getRowsByKey(keys: any[][]): TableRow[]; /** * @see getRowsByKey * * @param keys key values (see {@link TableRow.getKeyValues}). */ getRowByKey(key: any[]): TableRow; filterCount(): number; filteredRows(): TableRow[]; $rows(includeAggrRows?: boolean): JQuery; $aggregateRows(): JQuery; /** * @returns the first selected row of this table or null when no row is selected */ selectedRow(): TableRow; /** * @returns all selected rows in the same order as {@link rows}. */ selectedRowsSorted(direction?: 'asc' | 'desc'): TableRow[]; $selectedRows(): JQuery; $cellsForColIndex(colIndex: number, includeAggrRows?: boolean): JQuery; $cellsForRow($row: JQuery): JQuery; /** * @param column or columnIndex */ $cell(column: Column<any> | number, $row: JQuery): JQuery; /** * Searches for a column with the given ID. * * @param columnId the ID of the column to look for * @param type the type of the column to look for. The return value will be cast to that type. This parameter has no effect at runtime. * @returns the column for the requested ID or null if no column has been found. */ columnById<TColumn extends Column>(columnId: string, type: abstract new () => TColumn): TColumn; /** * Searches for a column with the given ID. * * If this table has a {@link columnMap}, its type has to contain a mapping for the given ID so the found column can be cast to the correct type. * If there is no concrete {@link columnMap}, the return type will be {@link Column}. * * @param columnId the ID of the column to look for * @returns the column for the requested ID or null if no column has been found. */ columnById<TId extends string & keyof ColumnMapOf<this>>(columnId: TId): ColumnMapOf<this>[TId]; /** * Searches for a column with the given {@link Column#buildUuid UUID}. * @param type optional type to cast the result to (without runtime check) * @returns the column for the requested UUID or `null` if no column has been found. */ columnByUuid<TColumn extends Column<any>>(columnUuid: string, type?: abstract new () => TColumn): TColumn; /** * @param $cell the $cell to get the column for * @param $row the $row which contains the $cell. If not passed it will be determined automatically * @returns the column for the given $cell */ columnFor$Cell($cell: JQuery, $row?: JQuery): Column<any>; columnsByIds<TId extends string & keyof ColumnMapOf<this>>(columnIds: TId[]): ColumnMapOf<this>[TId][]; /** * @deprecated use {@link visibleRows} instead. */ getVisibleRows(): TableRow[]; protected _updateRowStructure(options: UpdateTableRowStructureOptions): void; protected _rebuildTreeStructure(): void; protected _updateFilteredRows(applyFilters?: boolean, changed?: boolean): void; protected _updateVisibleRows(): void; protected _computeVisibleRows(rows?: TableRow[]): TableRow[]; visibleChildRows(row: TableRow): TableRow[]; protected _renderRowDelta(): void; /** * Sorts the given $rows according to the row index */ protected _order$Rows($rows?: JQuery): JQuery; protected _order$AggregateRows($rows?: JQuery): void; /** * @returns true if row state has changed, false if not */ protected _applyFiltersForRow(row: TableRow): boolean; /** * @returns labels of the currently active Filters that provide a createLabel() function */ filteredBy(): string[]; resetUserFilter(applyFilter?: boolean): void; hasUserFilter(): boolean; /** * Maps the given user filter states to user filters and sets them to the table. Existing user filters are replaced. */ applyUserFilterStates(userFilterStates: IUserFilterStateDo[]): void; resizeToFit(column: Column<any>, maxWidth?: number): void; protected _resizeToFit(column: Column<any>, maxWidth?: number, calculatedSize?: number): void; /** * @param filter The filter to add. * @param applyFilter Whether to apply the filters after modifying the filter list or not. Default is true. */ addFilter(filter: FilterOrFunction<TableRow>, applyFilter?: boolean): void; /** * @param filter The filter to remove. * @param applyFilter Whether to apply the filters after modifying the filter list or not. Default is true. */ removeFilter(filter: FilterOrFunction<TableRow>, applyFilter?: boolean): void; removeFilterByKey(key: string, applyFilter?: boolean): void; getFilter(key: string): Filter<TableRow>; /** * @param filter The new filters. * @param applyFilter Whether to apply the filters after modifying the filter list or not. Default is true. * @see TableModel.filters */ setFilters(filters: (FilterOrFunction<TableRow> | ObjectOrModel<TableUserFilter>)[], applyFilter?: boolean): void; protected _ensureFilter<T extends Filter<TableRow>>(filter: TableUserFilterModel | FilterOrFunction<TableRow>): Filter<TableRow>; filter(): void; protected _filter(options?: UpdateTableRowStructureOptions): void; protected _createFilterSupport(): FilterSupport<TableRow>; /** @see TableModel.textFilterEnabled */ setTextFilterEnabled(textFilterEnabled: boolean): void; isTextFilterFieldVisible(): boolean; protected _renderTextFilterEnabled(): void; protected _renderMultiSelect(): void; protected _renderMultiCheck(): void; updateFilteredElements(result: FilterResult<TableRow>, opts: UpdateFilteredElementsOptions): void; /** * Resizes the given column to the new size. * * @param column column to resize * @param width new column size */ resizeColumn(column: Column<any>, width: number): void; protected _renderResizeColumn(column: Column<any>, width: number): void; /** @internal */ _resizeAggregateCell($cell: JQuery): void; /** * @internal * Gets the aggregation cell range. this is the range from one aggregation cell with content to the next (or the table end). * @param $cell The cell to get the surrounding range * @returns All cells of the range to which the given cell belongs */ _getAggrCellRange($cell: JQuery): JQuery[]; /** * Updates the width and icon visibility of an aggregate cell in groupingStyle=title * @param $cell The aggregation cell that should be updated. */ protected _updateAggrCell($cell: JQuery): void; protected _getWidthWithMarginCached($element: JQuery): number; /** * Gets the computed space that is available to the content of the cell. * * @param $cell The aggregation cell for which the info should be computed * @param $icon The icon of the cell. May be null. * @returns The unused space available into flow direction of the cell til the end of the table or the next cell with content. */ protected _getAggrCellWidth($cell: JQuery, $icon: JQuery): number; /** * Sets the aggregation cell icon visible or not depending on the space available. * If the available space is big enough to hold the content of the cell text and the icon, the icon will become visible. Otherwise, the icon will be hidden. * This way no ellipsis will be shown as long as there is enough space for the text only. * * @param $icon The icon for which the visibility should be changed * @param $cellText The element holding the text of the cell. Required to compute if there is still enough space for text and icon or not * @param spaceAvailableForText The newly computed space available for the cell text. * @returns The new space available for the text. If the visibility of the icon changed, more or less space might become available. */ protected _updateAggrIconVisibility($icon: JQuery, $cellText: JQuery, spaceAvailableForText: number): number; /** * Moves the column to the new position. The position must be an index of {@link visibleColumns}. * * @returns true, if the column was moved, false if not. */ moveColumn(column: Column<any>, visibleNewPos: number): boolean; /** * Moves the given column to the new position without changing rows, triggering events and rendering the new state. * * @returns thew new visible position if it was adjusted by {@link considerFixedPositionColumns} * @internal */ _moveColumn(column: Column<any>, visibleColumns: Column<any>[], visibleOldPos: number, visibleNewPos: number): number; /** * Ensures the given visibleNewPos does not pass a fixed column boundary (necessary when moving columns) * * @returns the adjusted visibleNewPos if the position passes a fixed column boundary, otherwise the unmodified visibleNewPos */ considerFixedPositionColumns(visibleOldPos: number, visibleNewPos: number): number; protected _renderColumnOrderChanges(oldColumnOrder: Column<any>[]): void; protected _triggerRowsInserted(rows: TableRow[]): void; protected _triggerRowsDeleted(rows: TableRow[]): void; protected _triggerRowsUpdated(rows: TableRow[]): void; protected _triggerAllRowsDeleted(rows: TableRow[]): void; protected _triggerRowsSelected(debounce?: boolean): void; protected _triggerRowsChecked(rows: TableRow[]): void; protected _triggerRowsExpanded(rows: TableRow[]): void; protected _triggerFilter(): void; protected _triggerAppLinkAction(column: Column<any>, row: TableRow, ref: string, $appLink: JQuery): void; protected _triggerReload(reloadReason?: TableReloadReason): void; protected _triggerClipboardExport(): void; protected _triggerRowOrderChanged(): void; protected _triggerRowOrderChangeAnimation(row?: TableRow): void; protected _triggerColumnResized(column: Column<any>): void; protected _triggerColumnResizedToFit(column: Column<any>): void; protected _triggerColumnMoved(column: Column<any>, oldPos: number, newPos: number): void; protected _triggerAggregationFunctionChanged(column: NumberColumn): void; /** @see TableModel.headerVisible */ setHeaderVisible(visible: boolean): void; protected _renderHeaderVisible(): void; /** @see TableModel.headerEnabled */ setHeaderEnabled(headerEnabled: boolean): void; protected _renderHeaderEnabled(): void; /** @see TableModel.headerMenusEnabled */ setHeaderMenusEnabled(headerMenusEnabled: boolean): void; hasPermanentHeadOrTailSortColumns(): boolean; protected _setHeadAndTailSortColumns(): void; /** @see TableModel.tileMode */ setTileMode(tileMode: boolean): void; protected _setTileMode(tileMode: boolean): void; protected _ensureMediator(): void; protected _renderTileMode(): void; createTiles(rows: TableRow[]): Tile[]; protected _adaptTile(tile: Tile): void; createTileForRow(row: TableRow): Tile; /** @see TableModel.tileProducer */ setTileProducer(tileProducer: (row: TableRow) => Tile): void; protected _setTileTableHeader(tileTableHeader: TileTableHeaderBox): void; protected _createTileTableHeader(): TileTableHeaderBox; /** @see TableModel.rowIconVisible */ setRowIconVisible(rowIconVisible: