jquery - 选择 2 中没有可见的垂直滚动条
问题描述
我将 select 2 4.0.6-rc.0 与 bootstrap 4.3 一起使用
<div class="row option-select">
<div class="col-sm-6 country-col">
<select id="selection" class="custom-select custom-select-sm">
</select>
</div>
</div>
我正在通过 ajax 获取数据。一切正常,除了选择显示 5 个选项并且没有滚动条,因此即使有超过 10 个选项,我也无法查看更多选项。
<script type="text/javascript">
$(document).ready(function() {
$('#selection').select2({
ajax: {
url: './data/c-list.php',
type: 'post',
dataType: 'json',
delay: 250,
data: function (params) {
return {
searchTerm: params.term
};
},
processResults: function(response) {
return {
results: response
};
},
cache: true
}
});
});
解决方案
推荐阅读
- node.js - "Cannot set headers after they are sent"-error although using standard Express procedure
- join - 复杂的 Spotfire 加入
- async-await - 如何通过特征及其相关生命周期加入嵌套的 BoxFuture?
- sql - 尝试根据第三列中的值从两列之一返回总和(分组依据)结果
- sql - 如果 SQL 查询没有结果,则返回 0
- ssis - 使用 SSIS 中的执行进程任务和 WinSCP 从 SFTP 服务器下载以特定前缀开头的文件
- reactjs - 在 Styled-Components 中扩展组件时更改标记类型
- python - 转义在 Python shell 中的工作方式是否不同?(与文件中的代码相比)
- javascript - 是否可以阻止使用 Safari 桌面浏览器的客户端?
- sql - 如何比较 SQL 中的差异行