As the question seems unclear, I'm sorry if this answer is not directly related to the original intent.
For those using Select2 version 4+ and according to official plugin documentation, .select2("enable")
is not the way to go anymore for disabling the select box (not a single option of it). It will even be completely removed from version 4.1 onward.
Quoted directy from the documentation (see https://select2.org/upgrading/migrating-from-35#select2-enable):
Select2 will respect the disabled property of the underlying select element. In order to enable or disable Select2, you should call
.prop('disabled', true/false)
on the element. Support for the old methods will be completely removed in Select2 4.1.
So in the previous answer's example, it should be:
$('select').prop(disabled,true);