Задать вопрос

Тел: +7 965 3737 888

509

Просмотров

0

Ответов

Bootstrap button dropdown widget (replaces forms.Select)

<p>You need jQuery and Bootstrap 2 and bootstrap-dropdown.js. Apart from that, this should be a perfect drop-in replacement for the normal select widget. A jQuery event callback maintains a hidden input field from the user's selection. Upon loading the page, the hidden input field is set.</p>
<p>The SelectWidgetBootstrap also contains a &lt;noscript&gt; tag containing the normal forms.Select widget.</p>
<p>Example usage:</p>
class MyForm(forms.Form):
    group = forms.ModelChoiceField(models.Group.objects.all(), widget=SelectWidgetBootstrap(),
                                   empty_label=_(u'(no group selected)'))

Вопрос полезен? Да0/Нет0
file_2546.py(4.0Кб)
None