mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2026-03-13 10:32:25 +08:00
27 lines
857 B
HTML
27 lines
857 B
HTML
{% with id = 'form-select-' + name %}
|
|
<div class="form-group mb-3">
|
|
<div class="form-label">{{ label }}</div>
|
|
<select multiple class="form-select" name="{{ name }}" id="{{ id }}">
|
|
</select>
|
|
{% if help_text %}
|
|
<small class="form-hint">
|
|
{{ help_text }}
|
|
</small>
|
|
{% endif %}
|
|
</div>
|
|
<script>
|
|
new Choices(el = document.getElementById('{{ id }}'), {
|
|
classNames: {
|
|
containerInner: el.className,
|
|
listDropdown: 'dropdown-menu',
|
|
itemChoice: 'dropdown-item',
|
|
activeState: 'show',
|
|
selectedState: 'active',
|
|
inputCloned: 'bg-white',
|
|
},
|
|
removeItemButton: true,
|
|
choices:{{ options|safe }}
|
|
});
|
|
</script>
|
|
{% endwith %}
|