Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to set category id for Searchmethod #307

Open
mousavi-sh opened this issue May 28, 2023 · 1 comment
Open

how to set category id for Searchmethod #307

mousavi-sh opened this issue May 28, 2023 · 1 comment
Labels
Question Question about this project Triage Issue needs to be triaged

Comments

@mousavi-sh
Copy link

Dear
I uses multi blazoredtypeahead component in one page with one searchmethod function.
i need a unique Id to category data for each component.

private async Task<IEnumerable> SearchList(string searchText)
{
return await Task.FromResult(newList.Where(x => x.categoryId=listId && x.Name.Contains(searchText)).ToList());
}
how to pass ListId to this function?

@mousavi-sh mousavi-sh added Question Question about this project Triage Issue needs to be triaged labels May 28, 2023
@palktonderAtpowelno
Copy link

You can use a delegate as the SearchMethod and set the id per instance:

<BlazoredTypeahead SearchMethod="(searchString) => SearchList(searchString, 44)"

private async Task SearchList(string searchText, int listId)
{
return await Task.FromResult(newList.Where(x => x.categoryId=listId && x.Name.Contains(searchText)).ToList());
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Question about this project Triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants