The Rich Select Cell Editor supports loading values asynchronously, including paged loading and server-side filtering.
Async Values Copy Link
List values can be provided asynchronously to the editor as shown below:
The list of values to be selected from. Required when valuesPage is not provided. |
columnDefs: [
{
field: 'language',
cellEditor: 'agRichSelectCellEditor',
cellEditorParams: {
values: (_params) => fetch('/api/languages').then((res) => res.json()),
}
}
]
Paged Async Values Copy Link
For large datasets, valuesPage avoids loading all items at once and instead loads values on demand based on user scroll and interactions. valuesPageInitialStartRow can be used to set the initial position. The valuesPage callback should return a value that conforms to the RichCellEditorValuesPageResult interface.
Optional paged datasource for very large value lists. When provided, values are loaded incrementally and additional pages are requested as the user scrolls. If both values and valuesPage are set, valuesPage takes precedence.
|
Initial page start row when using valuesPage. Can be a fixed number or a callback that derives the start row from the current editor value. Only applied for the initial, unfiltered load. Filtered searches always start from row 0. |
Number of rows requested per page when using valuesPage. |
Number of rows from the end of the loaded list at which the next page is requested. |
columnDefs: [
{
cellEditor: 'agRichSelectCellEditor',
cellEditorParams: {
valuesPage: (params) : Promise<RichCellEditorValuesPageResult<string>> {
return fetch(`/api/languages?
startRow=${params.startRow}
&endRow=${params.endRow}`)
.then((res) => res.json());
},
valuesPageInitialStartRow: (value) => getRowForSelectedValue(value),
valuesPageSize: 100,
valuesPageLoadThreshold: 10
}
}
]
Async Filtering Copy Link
For advanced filtering scenarios, combine async values callback, allowTyping, and filterListAsync to enable async filtering.
When filterListAsync is set to true, the cell editor behaves as follows:
- It calls the
valuescallback with the current search term. - It delays the search request by 300ms (this can be adjusted using
searchDebounceDelay) to avoid excessive calls. - A loading indicator appears while the network request is in progress.
- Once the promise resolves, the dropdown is updated with the filtered results.
The list of values to be selected from. Required when valuesPage is not provided. |
Set to true to enable asynchronous filtering of values via the values or valuesPage callback. (only relevant when allowTyping=true and filterList=true). |
The value in ms for the search algorithm debounce delay |
This is shown in the example below:
columnDefs: [
{
field: 'language',
cellEditor: 'agRichSelectCellEditor',
cellEditorParams: {
allowTyping: true,
filterList: true,
filterListAsync: true,
values: (params): Promise<string[]> {
return fetch(`/api/languages?search=${encodeURIComponent(params.search)}`)
.then(res => res.json())
.then(data => data.items as string[])
}
}
]
Paged Async Filtering Copy Link
For very large, server-backed datasets, combine async filtering with valuesPage so filtered results are also loaded incrementally. valuesPageInitialStartRow is only used for the initial unfiltered load; once the user types, filtered paging starts from row 0.
In this mode each request includes:
searchfor the current filter text.startRowandendRowfor range-based pagination.cursor(optional) for cursor-based forward pagination APIs (undefinedon the first request, then replayed from the previous response).
Optional paged datasource for very large value lists. When provided, values are loaded incrementally and additional pages are requested as the user scrolls. If both values and valuesPage are set, valuesPage takes precedence.
|
Initial page start row when using valuesPage. Can be a fixed number or a callback that derives the start row from the current editor value. Only applied for the initial, unfiltered load. Filtered searches always start from row 0. |
Number of rows requested per page when using valuesPage. |
Number of rows from the end of the loaded list at which the next page is requested. |
Set to true to enable asynchronous filtering of values via the values or valuesPage callback. (only relevant when allowTyping=true and filterList=true). |
columnDefs: [
{
cellEditor: 'agRichSelectCellEditor',
cellEditorParams: {
allowTyping: true,
filterList: true,
filterListAsync: true,
valuesPageInitialStartRow: (value) => getRowForSelectedValue(value),
valuesPage: (params): Promise<RichCellEditorValuesPageResult<string>> {
return fetch(
`/api/languages
?search=${encodeURIComponent(params.search)}
&startRow=${params.startRow}
&endRow=${params.endRow}`
).then((res) => res.json());
},
}
}
]
API Copy Link
Properties available on the IRichCellEditorParams<TData = any, TValue = any, GValue = any> interface.
The list of values to be selected from. Required when valuesPage is not provided. |
Optional paged datasource for very large value lists. When provided, values are loaded incrementally and additional pages are requested as the user scrolls. If both values and valuesPage are set, valuesPage takes precedence.
|
Initial page start row when using valuesPage. Can be a fixed number or a callback that derives the start row from the current editor value. Only applied for the initial, unfiltered load. Filtered searches always start from row 0. |
Number of rows requested per page when using valuesPage. |
Number of rows from the end of the loaded list at which the next page is requested. |
The row height, in pixels, of each value. |
The cell renderer to use to render each value. Cell renderers are useful for rendering rich HTML values, or when processing complex data. |
The custom parameters to be used by the cell render. |
Set to true to be able to type values in the display area. |
If true it will filter the list of values as you type (only relevant when allowTyping=true). |
Set to true to enable asynchronous filtering of values via the values or valuesPage callback. (only relevant when allowTyping=true and filterList=true). |
The type of search algorithm that is used when searching for values. match - Matches if the value starts with the text typed. matchAny - Matches if the value contains the text typed. fuzzy - Matches the closest value to text typed. |
If true, each item on the list of values will highlight the part of the text that matches the input. Note: It only makes sense to use this option when filterList is true and searchType is not fuzzy. |
If true this component will allow multiple items from the list of values to be selected.
|
If true the option to remove all selected options will not be displayed. Note: This feature only works when multiSelect=true.
|
When multiSelect=true the editor will automatically show the selected items as "pills". Set this property to true suppress this behaviour.
|
The value in ms for the search algorithm debounce delay |
A string value to be used when no value has been selected. |
The space in pixels between the value display and the list of items. |
The maximum height of the list of items. If the value is a number it will be treated as pixels, otherwise it should be a valid CSS size string. |
The maximum width of the list of items. If the value is a number it will be treated as pixels, otherwise it should be a valid CSS size string. Default: Width of the cell being edited.
|
A callback function that allows you to change the displayed value for simple data. |
A callback function that allows you to convert the value of the Rich Select Editor to the data format of the Grid Column when they are different.
|