Skip to content

Instantly share code, notes, and snippets.

@yuchant
Last active November 1, 2019 03:45
Show Gist options
  • Save yuchant/d935208978a1fc6e3098 to your computer and use it in GitHub Desktop.
Save yuchant/d935208978a1fc6e3098 to your computer and use it in GitHub Desktop.
<link href="/static/css/select2.css" type="text/css" media="screen" rel="stylesheet" />
<script type="text/javascript" src="/static/js/select2.js"></script>
<script type="text/javascript">
$(function () {
select2Options = {
'width': 'resolve',
}
$("#content-main select:not(.select2-offscreen)").select2(select2Options);
Suit.after_inline.register('fire_up_select2', function(inline_prefix, row){
row.find('.select2-container').remove();
row.find('select').removeClass('select2-offscreen');
$(row.find('select')).select2(select2Options);
});
});
</script>
@tsassi
Copy link

tsassi commented Apr 3, 2015

Best solution ever. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment