Comments (5)
Hello, thank you for reporting this issue.
I've found the cause of the issue. It only happens on top-level arrays. If the array is nested inside an object or another array, then everything works fine.
I will fix this soon and release a new version by the end of this week.
Regarding changing the size of the input, you'll have to provide a CSS file with your custom styling through admin's or form's Media
class.
Also, using widget.attrs
will only affect the outer container of the JsonFormWidget. But it seems you want to change the size of the input field. In that case you'll have to provide a custom CSS file.
There should be a more elegant solution for custom styling and I'll see what can be done about it.
from django-jsonform.
if I wanted the fields in the multiselect to change dynamically based on another field, i.e. I choose the country of Italy in select1 and in select2, which would be an array field of django-jsonform, all the [{'label': Rome, 'value': 1}, ....]
would dynamically choices be possible? because I imagine that having a fixed schema for the widget this is not possible, the only way I can think of is to override where the select choices are checked in the schema.
To load the dictionary 'label' and 'value', could it be done with JQuery or JS, or could it be done somehow with this package?
from django-jsonform.
Currently, that is not possible.
But I will expose some methods and events to control the form widget using JS. This would allow for dynamically modifying the schema in the browser and updating the widget.
from django-jsonform.
Ok thanks, so I'm looking forward to this weekend for the top level array fix and future updates for dynamic array loading
from django-jsonform.
Fixed in v2.11.0. Please upgrade.
I've also implemented a basic JavaScript API which will allow you to dynamically modify the schema in the browser.
from django-jsonform.
Related Issues (20)
- Add option to show the json value HOT 1
- Including the JS in our own bundle? HOT 2
- Default layout of jsonform in Django Admin HOT 4
- Bug when using multi select with custom title HOT 5
- Object of type UUID is not JSON serializable HOT 1
- New release HOT 1
- Custom validation of object properties not showing error next to field HOT 2
- Form dynamics not working after reloading django-jsonform with HTMX HOT 3
- Using an object with empty Properties, having all properties inside AdditionalProperties HOT 3
- Setting JSONField schema dynamically HOT 3
- Copy-pasting / Duplications for Array items and Objects
- Horizontal display of properties HOT 1
- Dynamic header generation for array items HOT 2
- Customising "Add key" and "Add item" texts HOT 1
- Add button to open link in URLField HOT 5
- Decimal values not allowed when entering integer minimum and maximum for 'number' types HOT 4
- Define defaults for an array HOT 3
- Subfields in ArrayField should get the relevant input type
- Issue with errors for fields inside an anyOf schema not displaying correctly HOT 1
- validators for jsonfield are not updated with dynamic schema HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-jsonform.