ProTable - Advanced Table
ProTable was created to solve the problem of having to write a lot of sample code for tables in a project, so a lot of common logic was encapsulated in it. These wrappers can be simply categorized as pre-defined behaviors and pre-defined logic.
Built on ProForm, ProTable can switch query UI modes (for example full QueryFilter vs light filter) and also behave more like a plain form when using type="form".

When to Use
When your tables need to interact with the server or need rich cell renderers, ProTable is a good fit.
Issue regression scenarios
| ID | 名称 |
|---|---|
暂无数据 | |
API
ProTable puts a layer of wrapping on top of antd's Table, supports some presets, and encapsulates some behaviors. Only APIs that differ from antd Table are listed here.
request
request is the most important API of ProTable, request takes an object. The object must have data and success in it, and total is also required if manual paging is needed. request takes over the loading settings and re-executes them when the query form is queried and the params parameters are modified. Also the query form values and params parameters are brought in. The following is an example.
request is also supported in column configuration, but only for a few valueType.
ProTable
RecordCreator (EditableProTable)
ColumnStateType
Search Search form
optionRender: false only hides the action buttons. To query after an input or selection changes, call formRef.current?.submit() from form.onValuesChange; use ProTable's debounceTime to debounce requests.
Rules validation in the search form
To avoid blocking searches, the search form ignores validation rules from column-level formItemProps.rules by default (ProTable injects ignoreRules: true automatically). To enable validation in the search form, set it explicitly:
Once enabled, formItemProps.rules (such as required) take effect when submitting the search; a failed validation blocks the search request. Row-level validation in the editable table (editable) is not affected by this config.
ColConfig
Actual breakpoints come from antd design tokens (screenSMMin etc.) and can be customized via ConfigProvider theme; values above are defaults under default tokens.
Menu bar options configuration
ActionRef manually triggered
Sometimes we need to manually trigger the reload of the table and other operations, we can use actionRef.
Columns column definition
Requesting remote data is more complicated, please see here for details.
💡 Local sort/filter with
requestWhen you providerequest, ProTable will trigger a reload on sort/filter changes and pass server-relatedsort/filterintorequest(params, sort, filter)by default.
If you want client-side sorting/filtering (and do not want to trigger request):
- Local filter: configure both
filtersandonFilter(a function ortrue). - Local sort: set
sorterto a compare function, or{ compare }. Avoidsorter: true(it means server-side sorting). :::
valueType value type
ProTable encapsulates some commonly used value types to reduce repeated render operations. Configure a valueType to display formatted response data.
Batch operation
Like antd, batch operations need to be set to "rowSelection" to enable. Unlike antd, pro-table provides an alert to carry some information. You can customize it with tableAlertRender and tableAlertOptionRender. Set or return false to close.
Searching for forms
ProTable will generate a Form for filtering list data based on columns, and the final value will be returned based on the first parameter via request, which looks like.
As per the specification, table forms do not require any mandatory parameters, and all clicks on search and reset will trigger a request to initiate a query.
Form's columns are generated with different types based on valueType.
Columns with a valueType of index indexBorder option and no dataIndex and key will be ignored.
ListToolbar
Toolbar section for customizing forms.
ListToolBarProps
Toolbar configuration properties for lists and tables
SearchProps is a property of antd's Input.Search.