@adaptabletools/adaptable
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
64 lines (63 loc) • 1.6 kB
TypeScript
import { Column } from 'ag-grid-enterprise';
import { AdaptableColumnGroup, BaseContext } from '../types';
/**
* Options related to managing Columns in Adaptable.
*/
export interface ColumnOptions {
/**
* Provide an alternative Friendly Name for a Column
* @defaultValue undefined
*/
columnFriendlyName?: (columnFriendlyNameContext: ColumnFriendlyNameContext) => string | undefined;
/**
* Optional list of Column Types - used for Scope and creating Special Columns
* @defaultValue Empty Array
*/
columnTypes?: string[] | ((context: ColumnTypesContext) => string[]);
/**
* Log warning to console if AdapTable cannot find a column
*
* @defaultValue true
* @gridInfoItem
* @noCodeItem
*/
showMissingColumnsWarning?: boolean;
/**
* Appends the name of the Column Group to a Column's Friendly Name
*
* @defaultValue false
* @gridInfoItem
* @noCodeItem
*/
addColumnGroupToColumnFriendlyName?: boolean;
}
/**
* Context used when setting a Column Friendly Name
*/
export interface ColumnFriendlyNameContext {
/**
* Id of the Column
*/
colId: string;
/**
* AG Grid Display Name
*/
displayName: string;
/**
* AG Grid ColDef for the Column
*/
agColumn: Column;
/**
* Column Group Information
*/
columnGroup: AdaptableColumnGroup;
}
/**
* Context used when retrieving Column Types
*/
export interface ColumnTypesContext extends BaseContext {
/**
* Current Column Types
*/
types: string[];
}