!!!###!!!title=ListTable-columns-chart——VisActor/VTable option documents!!!###!!!!!!###!!!description=VisActor/VTable option documents. This chapter mainly introduces VTable configuration items and their usage to quickly generate the required tables.!!!###!!!

ListTable-columns-chart.cellType = 'chart'

Specify the column type as 'chart', the cellType can be omitted and defaults to 'text'

ListTable-columns-chart.headerType = 'text'

Specify header type, optional: 'text'|'link'|'image'|'video'|'checkbox', default 'text'.

ListTable-columns-chart.field

string

Required Specify the header field, corresponding to the data source attribute

ListTable-columns-chart.fieldFormat

FieldFormat

Configure data formatting

type FieldFormat = (record: any) => any;

ListTable-columns-chart.width

number
string

Specifies the column width, which can be a specific value, 'auto', or a percentage like '20%'. If 'auto' is specified, the column width will be automatically adjusted according to the length of the entire column text; If a percentage is specified, the current column width will be adjusted according to the total table width;

ListTable-columns-chart.maxWidth

number
string

Limit the maximum column width of this column

ListTable-columns-chart.minWidth

number
string

Limit the minimum column width of this column

ListTable-columns-chart.title

string

Header name

ListTable-columns-chart.headerStyle

IStyleOption
Function

Header cell style, configuration options are slightly different depending on the headerType. The configuration options for each headerStyle can be referred to:

  • When headerType is 'text', it corresponds to headerStyle
  • When headerType is 'link', it corresponds to headerStyle
  • When headerType is 'image', it corresponds to headerStyle
  • When headerType is 'video', it corresponds to headerStyle

ListTable-columns-chart.style

*

Body cell style, type declaration:

style?: IStyleOption | ((styleArg: StylePropertyFunctionArg) => IStyleOption);

The type declaration for the callback function argument StylePropertyFunctionArg is as follows:

interface StylePropertyFunctionArg {
  row: number;
  col: number;
  /** Table instance */
  table: TableAPI;
  /** If format exists, the formatted or calculated value */
  value: string;
  /** Original value */
  dataValue: string;
  /** Specific to ProgressBarType, represents the proportion of the current value in the overall data range */
  percentile?: number;
  /** Path information of cell header */
  cellHeaderPaths: ICellHeaderPaths;
}

The type structure of IStyleOption is as follows:

Click to expand

ListTable-columns-chart.headerIcon

string
Object
Array

Header cell icon configuration. Available configuration types are:

string | ColumnIconOption | (string | ColumnIconOption)[];

For the specific configuration of ColumnIconOption, refer to the definition

ListTable-columns-chart.icon

string
Object
Array
Funciton

Body cell icon configuration.

icon?:
    | string
    | ColumnIconOption
    | (string | ColumnIconOption)[]
    | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);
Click to expand

ListTable-columns-chart.sort

boolean
Function

Whether to support sorting, or define a function to specify sorting rules

ListTable-columns-chart.showSort

boolean

Whether to display the sort icon, no real sorting logic. If the sort field is set, this can be omitted

ListTable-columns-chart.disableHover

boolean

This column does not support hover interaction behavior

ListTable-columns-chart.disableSelect

boolean

This column does not support selection

ListTable-columns-chart.disableHeaderHover

boolean

This header column does not support hover interaction behavior

ListTable-columns-chart.disableHeaderSelect

boolean

This header column does not support selection

ListTable-columns-chart.description

string

The description of the header when hover, which will be displayed in the form of a tooltip

ListTable-columns-chart.dropDownMenu

Array

The drop-down menu item configuration. The drop-down menu item can be a first-level menu item or a second-level menu item, as long as there is a configuration. The specific type is MenuListItem[].

ListTable-columns-chart.headerCustomRender

Function
Object

Custom rendering of header cell, in function or object form. The type is: ICustomRenderFuc | ICustomRenderObj.

demo link tutorial link

The definition of ICustomRenderFuc is:

 type ICustomRenderFuc = (args: CustomRenderFunctionArg) => ICustomRenderObj;

The type declaration for callback function argument CustomRenderFunctionArg is:

interface CustomRenderFunctionArg {
  row: number;
  col: number;
  table: TableAPI;
  /**Formatted value */
  value: string|number;
  /**Original value */
  dataValue: string|number;
  rect?: RectProps;
}

The definition of ICustomRenderObj is as follows:

export type ICustomRenderObj = {
  /** Configured type collection */
  elements: ICustomRenderElements;
  /** Desired cell height */
  expectedHeight: number;
  /** Expected cell width */
  expectedWidth: number;
  /**
   * Do you still need to render content by default? Only if the configuration is true, it will be drawn. By default, it will not be drawn.
   */
  renderDefault?: boolean;
};

Detailed configuration instructions are as follows:

Click to expand

ListTable-columns-chart.headerCustomLayout

Function

Custom layout element definition for header cell, suitable for complex layout cell content.

(args: CustomRenderFunctionArg) => ICustomLayoutObj;

The type declaration for callback function argument CustomRenderFunctionArg is:

interface CustomRenderFunctionArg {
  row: number;
  col: number;
  table: TableAPI;
  /**Formatted value */
  value: string|number;
  /**Original value */
  dataValue: string|number;
  rect?: RectProps;
}

The ICustomLayoutObj type is defined as follows

export type ICustomLayoutObj = {
  rootContainer: Container | any;
  /**
   * Do you still need to render content by default? Only if the configuration is true, it will be drawn. By default, it will not be drawn.
   */
  renderDefault?: boolean;
  /**
   * Whether to also enable padding in style
   */
  enableCellPadding?: boolean;
};

Detailed configuration instructions are as follows:

Click to expand

ListTable-columns-chart.customRender

Function
Object

Custom rendering for body cell header cell, in function or object form. The type is: ICustomRenderFuc | ICustomRenderObj.

demo link tutorial link

The definition of ICustomRenderFuc is:

 type ICustomRenderFuc = (args: CustomRenderFunctionArg) => ICustomRenderObj;

The type declaration for callback function argument CustomRenderFunctionArg is:

interface CustomRenderFunctionArg {
  row: number;
  col: number;
  table: TableAPI;
  /**Formatted value */
  value: string|number;
  /**Original value */
  dataValue: string|number;
  rect?: RectProps;
}

The definition of ICustomRenderObj is as follows:

export type ICustomRenderObj = {
  /** Configured type collection */
  elements: ICustomRenderElements;
  /** Desired cell height */
  expectedHeight: number;
  /** Expected cell width */
  expectedWidth: number;
  /**
   * Do you still need to render content by default? Only if the configuration is true, it will be drawn. By default, it will not be drawn.
   */
  renderDefault?: boolean;
};

Detailed configuration instructions are as follows:

Click to expand

ListTable-columns-chart.customLayout

Function

Custom layout element definition for body cell, suitable for complex layout content.

(args: CustomRenderFunctionArg) => ICustomLayoutObj;

The type declaration for callback function argument CustomRenderFunctionArg is:

interface CustomRenderFunctionArg {
  row: number;
  col: number;
  table: TableAPI;
  /**Formatted value */
  value: string|number;
  /**Original value */
  dataValue: string|number;
  rect?: RectProps;
}

The ICustomLayoutObj type is defined as follows

export type ICustomLayoutObj = {
  rootContainer: Container | any;
  /**
   * Do you still need to render content by default? Only if the configuration is true, it will be drawn. By default, it will not be drawn.
   */
  renderDefault?: boolean;
  /**
   * Whether to also enable padding in style
   */
  enableCellPadding?: boolean;
};

Detailed configuration instructions are as follows:

Click to expand

ListTable-columns-chart.dragHeader

boolean

Whether the header can be dragged

ListTable-columns-chart.columnWidthComputeMode

string

Column width calculation mode: 'normal' | 'only-header' | 'only-body', only-header considers only the header content only-body considers only the body content normal can display all content

ListTable-columns-chart.disableColumnResize

boolean

Whether to disable column width adjustment. If it is a transposed table or a pivot table with row-oriented indicators, this configuration does not take effect.

ListTable-columns-chart.tree

boolean

Whether to display this column as a tree structure, which needs to be combined with the records data structure to be implemented, the nodes that need to be expanded are configured with children to accommodate sub-node data. For example:

{
    "department": "Human Resources Department",
    "monthly_expense": "$45000",
    "children": [
      {
        "group": "Recruiting Group",
        "monthly_expense": "$25000",
        "children": [
          {
            "name": "John Smith",
            "position": "Recruiting Manager",
            "salary": "$8000"
          },
      }
    ]
}

ListTable-columns-chart.editor

string
Object
Function

Configure the column cell editor

editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);

Among them, IEditor is the editor interface defined in @visactor/vtable-editors. For details, please refer to the source code: https://github.com/VisActor/VTable/blob/main/packages/vtable-editors/src/types.ts .

ListTable-columns-chart.headerEditor

string
Object
Function

Configure the display title of this column header

headerEditor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);

ListTable-columns-chart.columns

Array

Configure arrays with upper columns, nesting structures to describe column grouping relationships.

ListTable-columns-chart.hideColumnsSubHeader

Whether to hide the header title of the subtable header. The default value is not hidden.

ListTable-columns-chart.aggregation(Aggregation | CustomAggregation | Array)

*

Not required.

Data aggregation summary configuration to analyze the column data.

Global options can also be configured to configure aggregation rules for each column.

Please refer to the tutorial document

ListTable-columns-chart.hide

Not required.

Weather hide column.

ListTable-columns-chart.chartModule

string

Chart type exclusive configuration options

Corresponding to the injected chart library component name

ListTable-columns-chart.chartSpec

any
Function

Chart type exclusive configuration options

Set the spec of the chart, or set it to a function that returns a different spec. The data displayed in the chart is provided by records.

ListTable-columns-chart.noDataRenderNothing

Do not render the chart when there is no data. Defaults to false