Improve TemplateWidget JavaScript
Move widget initialization from form to field. Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -16,9 +16,11 @@ class TemplateWidget(NamedMultiWidget):
|
||||
def __init__(self, attrs=None, **kwargs):
|
||||
widgets = OrderedDict()
|
||||
|
||||
widgets['model_property'] = forms.widgets.Select()
|
||||
widgets['model_property'] = forms.widgets.Select(
|
||||
attrs={'data-template-fields': 'model_property'}
|
||||
)
|
||||
widgets['template'] = forms.widgets.Textarea(
|
||||
attrs={'rows': 5}
|
||||
attrs={'rows': 5, 'data-template-fields': 'template'}
|
||||
)
|
||||
super(TemplateWidget, self).__init__(
|
||||
widgets=widgets, attrs=attrs, **kwargs
|
||||
|
||||
Reference in New Issue
Block a user