jmrivas86 / django-json-widget

An alternative widget that makes it easy to edit the new Django's field JSONField (PostgreSQL specific model fields)
MIT License
433 stars 88 forks source link

Custom width height in config Form #28

Closed idontgotit closed 4 years ago

idontgotit commented 4 years ago

Description

How to use custom width and height in form django admin with key JSONEditorWidget() . I cant found any example like this. I see configuration said :

width: Width of the editor as a string with CSS size units (px, em, % etc). Defaults to 90%. height: Height of the editor as a string CSS size units. Defaults to 550px.

What I Did

My config work perfect, without it look so big

class ServiceForm(forms.ModelForm):
    class Meta:
        model = Service
        widgets = {
            'test': JSONEditorWidget(),
        }

i try JSONEditorWidget(with="50") But editor not accept this param

My pip list show version is 0.2.0. But in your project, file widgets.py have more param than my version pip downloaded. It maybe this problem. thanks

jmrivas86 commented 4 years ago

I closed this issue, is solved in the latest version.