Skip to content
Docs
Container
Data Container - Data Table

Data Table

Latest Update:Jul 26, 2023, 10:35:08

Scenarios

This is suitable for pages that require displaying content in a list format. You can use this container component for that purpose.

Basic Functions

This container is an integrated component-container, and you can select a data model for the container. You can choose data fields for each column in the container.

  1. Quickly Select Data Model

    As shown in the figure, you can directly choose a data table and configure query parameters. The table's internal requests come with built-in pagination, sorting, filtering, and other functions. By clicking in the upper right corner, you can navigate to the data table's management backend to view the data.

  1. Select Query

    After binding a data model to the data table, you need to call the data model's query method to retrieve data.

    Selecting the data model's query list method will, by default, return the data that can be used in the data table and automatically render it in the data list.

  2. Calling API Parameters Requirements

    When choosing "APIs" as the "Data Source Type," you can bind API methods to query data and display it in the table. The method needs to include the following input and output parameters and meet the relevant requirements.

Method Input:

pageNo:Page number pageSize:Number of items per page orderBy:Name of the sorting field, can take values from various fields in the output (optional - sorting control won't be possible without this parameter) orderType:Sorting order, use "asc" for ascending and "desc" for descending (optional - sorting control won't be possible without this parameter)

total:Total number of records records: Multiple data records in an array of objects, where each element corresponds to a table column. Note: Each object in the array must include a unique identifier field, _id (text type), for features like pagination to function properly.

The field identifiers must be exactly consistent with the identifiers mentioned above, and they must all be top-level parameters.

Property Introduction

Properties received from external input for the component:

Property NameProperty Description
Data ModelWhen using data from a data model, you need to select the data model
Static DataIn the absence of a model, users can choose static data for display
Data FilteringUsers can filter valid data for display
Sorting FieldThe field by which the current list is sorted
Sorting OrderThe sorting order for the currently selected sorting field: ascending or descending
No Data PromptThe text displayed when the current table has no data
Items Per PageThe default value for the number of items displayed per page in the current table
PaginationThe mode in which the table uses pagination: paginator, click to load, scroll to load, no pagination
Show Data TotalDisplay the total number of data after the current query
Change Items Per PageWhether the paginator can change the number of items displayed on the current page
Selectable RowsWhether the first column of the current table rows can be selected
Conditional FilteringWhether the current table supports default conditional filtering
Filter FieldsWhen conditional filtering is supported, filter the fields based on a certain condition
ExportableWhether the current table supports exporting to Excel
Sort ButtonsWhether the columns in the table support sorting buttons
Column ManagementIndividual settings for columns in the table
Freeze From First ColumnSettings to freeze the left-side columns of the table when dragging the table
Freeze To Last ColumnSettings to freeze the right-side columns of the table when dragging the table
Display Action ColumnThe system automatically adds an "Action Column" to the table, which can include custom buttons
Display Button GroupThe button group at the top of the table, where you can add custom action buttons
Special Style RowsWhen a certain value meets specific conditions, it is displayed in a special color
Enable Zebra StripesEnable zebra stripes for the current table to make it easier for users to view rows
Cell BordersDisplay cell borders

Events

Property NameProperty Description
Page LoadAn event triggered when the current component loads
Selected Rows in TableAn event triggered when the current component loads
Pagination CallbackAn event triggered when the current component loads