Is it possible to configure a select2 control to automatically select an item when the ajax response contains extra data?
I am looking to set up my controller to mark an item as an exact match in the JsonResult and have the select2 control automatically select it without needing to open the dropdown menu.
From the user's perspective: If the user types in a string that exactly matches an item in the controller, for example if they input a barcode and the controller finds a matching bar-code. The Select2 control will immediately highlight that item without requiring the user to manually open the dropdown menu.
If the user types in a query that does not exactly match any items in the controller, the controller will return a list of potential options without the "exact" parameter and the Select2 control will open the dropdown menu to display these options to the user.