Open Closed

Refreshing Select2 Data and Retaining Selected Options #5229


User avatar
0
dan@dancaron.com created

I am using the abp.io Select2 auto-complete-select. How do I refresh the "available options" data from the Select2 box without clearing out any selected options?

I have a use case where the list of available options changes **after ** the user has clicked the drop-down to retrieve the list of available options (i.e. they can create a new item while on the screen - so I need to refresh the data (available options) so the new item is there - but I need to retain any selected items).

<select id="TagsLookup" asp-for="Message.TagIds" class="auto-complete-select" multiple="multiple" style="width: 100%" data-autocomplete-api-url="/api/mymodule/messages/item-lookup" data-autocomplete-display-property="displayName" data-autocomplete-value-property="id" data-autocomplete-items-property="items" data-autocomplete-filter-param-name="filter"> </select>

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

No answer yet!
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.