SelectAsyncChoicesWidgetThis is a React component
SourceA Select widget that handles async choices
Parameter | Type | Description | |
---|---|---|---|
* | props | Most Select props in addition to the below. Note the
following restrictions: | |
props.accumulatePages | boolean | Whether pages should be accumulated as more are fetched. This defaults to true and means that whenever the next page is fetched it is appended to the bottom of the list. Defaults to | |
* | props.asyncChoices | AsyncChoicesInterface | The AsyncChoices instance to use. |
props.buildQuery | Function | Function to build query object to pass through to By default this will be an object containing a the current search keywords
under the key The function is passed an object containing
Defaults to | |
props.clearOnOpen | boolean | Whether to clear and fetch fresh results when the drop down is opened after the initial fetch. If this is set to false then the only time fresh results are fetched will be when the search filter changes or a new page of results is retrieved. This defaults to | |
props.debounceWait | number | Number of milliseconds to debounce changes to search keywords before an API call will be triggered. Set to 0 to disable. Defaults to | |
* | props.input | SelectInputProps | |
props.listOptions | Record | Any extra options to pass through to list These will be available in both useListProps and list under the | |
props.loadingContent | React.ReactNode | Content to show when the dropdown is open and in the loading state. This it passed through
to Defaults to | |
props.nextPageOptionProps | Record | Any extra props to pass through to the Select.Option that wraps the next page button. This can be useful for thing like passing className or ID's for testing, eg:
| |
props.onRetrieveError | Function | If provided this function will be called whenever You can use this to do things like unset a value if it no longer exists. | |
props.onRetrieveSuccess | Function | If provided this function will be called whenever a value is successfully
resolved using | |
props.optionProps | Record | Any extra props to pass through to Select.Option. This can be useful for thing like passing className or ID's for testing, eg:
| |
props.renderNextPageButton | false| Function | Function to render the button for fetching the next page of results. Function is passed an object with:
Can pass Note that this is always rendered within a Select.Option.
You can pass Defaults to:
| |
props.retrieveOptions | Record | Any extra options to pass through to retrieve These will be available in both useRetrieveProps and retrieve under the | |
props.triggerWhenClosed | boolean | Whether to call the Endpoint immediately when the select has not been opened (eg. before the initial open and after it's closed when the search value is cleared) Defaults to |