Problem in using ajax kartik select2 in modal popup


I have a select2 widget displayed in a form which is shown up using a modal popup. From this issue I see there’s the chance to use the pjaxContainerId attribute to reinitialize the widget, but I’m not using pjax… I just use Modal, and using ajax (following this guide) I open the create link and put the content into the modal.

How can I reinitialize the select2 when the modal loads?