Hi
Is it possible to use the Blazor AutoComplete component to query an API every time the user enters a letter?
For example the following API will return a list of (up to 10) stocks that contain the letters "coi" in their names:
GET: https://api.nasdaq.com/api/autocomplete/slookup/10?search=coi
Ideally i would want the API queried after every letter that the user enters in order to narrow down the selection.
You can see an autocomplete textbox here that behaves in that way: https://www.nasdaq.com/market-activity/stocks/screener
Any idea how to achieve this using the autocomplete component?
|
private async Task OnFilter(FilteringEventArgs args)
{
args.PreventDefaultAction = true;
var query = new Query().Where(new WhereFilter() { Field = "Name", Operator = "contains", value = args.Text, IgnoreCase = true });
query = !string.IsNullOrEmpty(args.Text) ? query : new Query();
await autoObj.FilterAsync(Country, query);
}
|
Thanks for your assistance Ponmani.
James