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

Dynamic header generation for array items

Open ErikKoinberg opened this issue 1 year ago • 2 comments

It would be nice to have an option to generate dynamic headers when adding new items to an array. Perhaps a property called objectName or something like that is needed. For an object name "Book", it would be cool to get subheaders for the items like Book 1, Book 2 etc.

ErikKoinberg avatar Feb 13 '24 10:02 ErikKoinberg

Any ideas how this can be implemented?

Only way I can think of is to execute a JS function every time a new item is added and that function will return a new header?

bhch avatar Feb 14 '24 03:02 bhch

Yes, I agree. The function will have to look at the schema for what the object type name is as well as how many instances there currently are in the data. With reordering or even duplications, this gets even trickier.

ErikKoinberg avatar Feb 14 '24 17:02 ErikKoinberg