【发布时间】:2021-10-10 11:29:18
【问题描述】:
在加载过程中,我需要在 select2 组件中的每个列表项旁边创建一个按钮(视图)。 我没有在网上找到任何可以帮助我的东西。 有人知道怎么做吗?
$("#MySelect2").select2({
tags: "true",
createTag: function () {
// Dessabilita a inserção quando Enter for pressionada
return null;
},
placeholder: "Selecione uma opção",
allowClear: false,
width: '100%',
dropdownParent: genericModal,
language: {
noResults: function () {
return "Nenhum resultado encontrado";
}
}
});
<div class="col-md-4">
<label asp-for="ParentescoTipoId" class="control-label">Tipo de Parentesco</label>
<select asp-for="ParentescoTipoId" asp-items="Model.ParentescosTipos" id = "MySelect2" title="Selecione uma opção" class="form-control sel-pessoa-fisica-parentesco-parentesco-tipo" style="position: fixed !important;"><option value=""></option></select>
<span asp-validation-for="ParentescoTipoId" class="text-danger"></span>
</div>
谢谢:)
【问题讨论】:
标签: javascript jquery select jquery-select2