Progress/animated gif not showing

How do I get the progress indicator/animated gif to show when I am making an ajax call to populate/filter the select2 box.

I’ve scoured the Select2 documentation and I don’t see any built-in option to provide or display a progress indicator, so you’ll have to roll it yourself. Also, while Select2 uses the jQuery.ajax() method by default for its AJAX processing, and jQuery.ajax() provides some events that can inform the calling application about the status of the request, I don’t see any way to access the return value from the jQuery.ajax() method call (i.e., the jqXHR object, which gives access to those events).

So my advice would be to do the jQuery.ajax() call yourself, rather than using Select2’s ajax option, and dump the results into a data array that you then use to initialize the Select2 widget. That will give you access to the jqXHR object, and you can use its events to display/update/hide your loading indicator.