我dropdownautowidth
在我的SharePoint搜索页面上使用select2将其设置为true,这是第一次在页面加载时完美运行.在我搜索某个关键字后,页面会加载搜索结果,然后dropdownautowidth不会以某种方式设置为true.我正在使用$('#ddlCategory').select2({dropdownAutoWidth : true});
我的document.ready
功能声明.
任何帮助表示赞赏.
你需要引用它,比如:
$('#ddlCategory').select2({dropdownAutoWidth: 'true'});
这对我有用.
在select2 4.0.0中,这对我来说也不起作用.我用这个解决方法:
$('select').select2();
css:
select + .select2-container { width: 100% !important; }
这对我有用:
$('select').select2({ dropdownAutoWidth : true, width: 'auto' })