!!!###!!!title=ListTable-columns-checkbox——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-checkbox.cellType = 'checkbox'

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

ListTable-columns-checkbox.headerType = 'text'

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

ListTable-columns-checkbox.field

string

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

ListTable-columns-checkbox.fieldFormat

FieldFormat

Configure data formatting

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

ListTable-columns-checkbox.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-checkbox.maxWidth

number
string

Limit the maximum column width of this column

ListTable-columns-checkbox.minWidth

number
string

Limit the minimum column width of this column

ListTable-columns-checkbox.title

string

Header name

ListTable-columns-checkbox.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-checkbox.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-checkbox.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-checkbox.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-checkbox.sort

boolean
Function

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

ListTable-columns-checkbox.showSort

boolean

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

ListTable-columns-checkbox.disableHover

boolean

This column does not support hover interaction behavior

ListTable-columns-checkbox.disableSelect(boolean | ((col: number, row: number, table: BaseTableAPI) => boolean))

*

This column does not support selection

ListTable-columns-checkbox.disableHeaderHover

boolean

This header column does not support hover interaction behavior

ListTable-columns-checkbox.disableHeaderSelect

boolean

This header column does not support selection

ListTable-columns-checkbox.description

string

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

ListTable-columns-checkbox.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-checkbox.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-checkbox.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-checkbox.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-checkbox.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-checkbox.dragHeader

boolean

Whether the header can be dragged

ListTable-columns-checkbox.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-checkbox.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-checkbox.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-checkbox.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-checkbox.headerEditor

string
Object
Function

Configure the display title of this column header

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

ListTable-columns-checkbox.columns

Array

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

ListTable-columns-checkbox.hideColumnsSubHeader

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

ListTable-columns-checkbox.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-checkbox.hide

Not required.

Weather hide column.

ListTable-columns-checkbox.checked

boolean
Function

Configuration item exclusive to checkbox type

Whether the checkbox is in the checked state, setting here means specifying the checkbox state of the entire column. If there is a corresponding state in the record data entry, the state in the data will be used first.

If headerType is set to checkbox, the status of the header checkbox will depend on this setting. If this setting is empty, it will depend on the checked status of each piece of data.

ListTable-columns-checkbox.disable

boolean
Function

Configuration item exclusive to checkbox type

Whether the checkbox is in a disabled interactive state