English
list.render.before
About 599 wordsAbout 2 min
2025-12-16
This hook is called before rendering the object table. Extra actions can be performed before list rendering, including but not limited to the following capabilities:
- Custom filters
Parameters
| Parameter | Description | Type | Optional Values | Default |
|---|---|---|---|---|
| Common parameters | [See details](../common/Common Parameters.md) | Object | — | — |
Return Value
| Parameter | Description | Type | Default |
|---|---|---|---|
| columnsExtendConfig | Column extension configuration | Object | -- |
| filterExtendConfig | Filter extension configuration | Object | -- |
| termExtendConfig | Scenario extension configuration | Object | -- |
| imageExtendConfig | Image field extension configuration | Object | -- |
| viewInfoExtendConfig | View extension configuration | Object | -- |
| actionExtendConfig | Button extension configuration | Object | -- |
| formatListDataAsync | Formats listData (data returned by the List interface) | Function | -- |
| formatRequestParam | Formats request parameters of the List interface | Function | -- |
| forceTrWrap | Whether list cells are forcibly displayed with line breaks | Boolean | -- |
| allSummaryFields | Summary statistic fields across all pages of the list page | Array | -- |
| summaryFields | Summary statistic fields of the current page | Boolean | -- |
| enableLiveFiltering | Whether real-time search is enabled in list filtering | Boolean | -- |
columnsExtendConfig
| Parameter | Description | Type | Default |
|---|---|---|---|
| filterColumns | Filters table display fields, and also affects table settings and filtering | Array | -- |
| render | Custom cell rendering configuration | Object | -- |
| showLookupText | Whether a lookup field only displays text (which means it is not clickable) | Boolean | false |
columnsExtendConfig.render
| Parameter | Description | Type | Default |
|---|---|---|---|
| Field render function | Function | -- |
filterExtendConfig
| Parameter | Description | Type | Default |
|---|---|---|---|
| Filter configuration for the field | Object | -- |
filterExtendConfig.
| Parameter | Description | Type | Default |
|---|---|---|---|
| disabled | Disables filtering for the field | Boolean | -- |
| onlyOr | Operators to retain | Array | -- |
| components | Filter field components corresponding to different operators | Object | -- |
| filterOptions | Filters options for single-select / multi-select field types | Function | -- |
| defaultCompare | Default operator | Number | -- |
termExtendConfig
| Parameter | Description | Type | Default |
|---|---|---|---|
| default | Default scenario to display, requires a filter scenario ID | String | -- |
| retain | Scenarios to retain, requires filter scenario IDs | Array | -- |
imageExtendConfig
| Parameter | Description | Type | Default |
|---|---|---|---|
| Configuration related to image fields | Object | -- |
imageExtendConfig.
| Parameter | Description | Type | Default |
|---|---|---|---|
| previewWidth | Width of the enlarged preview image when hovering over an image field | number | 0 |
| previewHeight | Height of the enlarged preview image when hovering over an image field | number | 200 |
actionExtendConfig
| Parameter | Description | Type | Default |
|---|---|---|---|
| Button configuration in the top-right corner of the list | Object | -- |
actionExtendConfig.
| Parameter | Description | Type | Default |
|---|---|---|---|
| parseParam | Formats the parameters when the button is executed | Function | -- |
formatRequestParam
Basic Example
export default class Plugin {
apply() {
return [{
event: "list.render.before",
functional: this.renderBefore.bind(this)
}];
}
renderBefore() {
const formatRequestParam = (data) => {
const search_query_info = JSON.parse(data.search_query_info);
if (!search_query_info.filters) {
search_query_info.filters = [];
}
search_query_info.filters.push({
field_name: 'name',
field_values: ['value'],
operator: 'LIKE'
})
data.search_query_info = JSON.stringify(search_query_info);
return data;
};
return Promise.resolve({
formatRequestParam
})
}
}allSummaryFields
| Parameter | Description | Type | Default |
|---|---|---|---|
| type | Fixed value sum | String | -- |
| field_name | Field apiName | String | -- |
| api_name | Concatenated from type and field_name, in the format $type_$field_name | String | -- |
summaryFields
| Parameter | Description | Type | Default |
|---|---|---|---|
| type | Fixed value sum | String | -- |
| field_name | Field apiName | String | -- |
Examples
Hide a column from the list
export default class Plugin {
apply() {
return [{
event: "list.render.before",
functional: this.renderBefore.bind(this)
}];
}
renderBefore() {
return Promise.resolve({
columnsExtendConfig: {
filterColumns: ['name'],
}
})
}
}Customize the display content of a specific cell
export default class Plugin {
apply() {
return [{
event: "list.render.before",
functional: this.renderBefore.bind(this)
}];
}
renderBefore() {
return Promise.resolve({
columnsExtendConfig: {
render: {
owner: (value, type, data, format, index, field) => {
return 'Hello, Fxiaoke';
}
}
}
})
}
}Disable filtering for a field
Filter supported operators for a field in the filter panel
Customize the filter component corresponding to an operator
Filter options for single-select / multi-select fields in the list filter
Set the default filter scenario and retain part of the scenarios
Set image preview size for image fields
Extend parameters when executing top-right list buttons
FAQ
Q: Why does the second page of data not update after pagination when modifying list request parameters through formatListDataAsync?
A: Please check whether the formatListDataAsync function uses parameters such as limit and offset. If so, remove them.
