Add 'searchKey' to Combo #11532
Labels
combo
🧰 feature-request
✅ status: resolved
Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Please add a "searchKey" input to the IGX Combo component which tells the combo which data key to use to search/filter by. Right now the search automatically uses the "displayKey" to search and filter the drop down options. However, if you are using custom templates for displaying drop down items in the combo, you might have additional info you'd like to include in the search. By providing a "searchKey" (which defaults to the displayKey value) you can have the search filter by a different data key value which might have more information.
Additional context
Example: I have combo using an array of employee data. The employee data array consists of objects with id, name, division, name_and_division. The "displayKey" is set to "name". I have a custom template to display which prefixes the employee's division to their name (i.e. "Corporate: John Doe"). I'd like to be able to type "corporate" in the search field and have it also match employees at corporate by searching the "name_and_division" property values instead of the just the "name" property. Then when I select an employee, just their "name" appears in the input field box and not their "name and division".
The text was updated successfully, but these errors were encountered: