- Make the multi object form perform an auto submit when the value is changed.
- Add multiple object select checkbox that was missing in the list item subtemplate. Signed-off-by: Eric Riggs <ericriggs42@gmail.com>
This commit is contained in:
committed by
Roberto Rosario
parent
0a05c87c9c
commit
eceb3ed877
@@ -7,8 +7,15 @@ from django.utils.translation import ugettext_lazy as _
|
||||
class MultiItemForm(forms.Form):
|
||||
def __init__(self, *args, **kwargs):
|
||||
actions = kwargs.pop('actions', [])
|
||||
if actions:
|
||||
actions.insert(0, ['', '---'])
|
||||
|
||||
super(MultiItemForm, self).__init__(*args, **kwargs)
|
||||
|
||||
self.fields['action'].choices = actions
|
||||
|
||||
action = forms.ChoiceField(label=_('Actions'), required=False)
|
||||
action = forms.ChoiceField(
|
||||
label='', required=False, widget=forms.widgets.Select(
|
||||
attrs={'class': 'select-auto-submit'}
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user