django-jsonform icon indicating copy to clipboard operation
django-jsonform copied to clipboard

JSONFieldWidget attrs

Open hdeng88 opened this issue 1 year ago • 1 comments

Screenshot 2024-05-13 at 15 06 41

Trying to make the JSONField input box wider, but attrs does not seem to work. Could you please provide a template for JSONFormWidget attrs settings?

"JSONFormWidget classJSONFormWidget(schema, model_name='', file_handler='', validate_on_submit=False**, attrs=None)"**

I tried in forms.py:

'person_all_names': JSONFormWidget(schema=PersonModel.name_SCHEMA,attrs={'style': 'width: 300%; height: 100%;'}),

but did not work...

Maybe the JSONFormWidget does not take in attrs -- 'style'?

hdeng88 avatar May 13 '24 19:05 hdeng88

I found out the issue but no solution:

the attrs does work but only on the class of widget container.

Suggest to add a width/height parameter. Thanks

hdeng88 avatar May 13 '24 20:05 hdeng88